10 Star 0 Fork 16

src-openEuler/nmap

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-nping-fix-out-of-bounds-access.patch 1.04 KB
一键复制 编辑 原始数据 按行查看 历史
xingwei 提交于 2023-08-23 17:24 . nping:fix out of bounds
From 54a0c1440188a76f370b14d40777716a8761d0a8 Mon Sep 17 00:00:00 2001
From: "jay.fink" <jay.fink@0c474577-fa26-0410-a966-bdb198e94e9e>
Date: Wed, 13 Oct 2010 00:39:53 +0000
Subject: [PATCH] approved by dugsong@ Fix an off by one. Issue number 9 in
google code.
Conflict: NA
Reference: https://github.com/ofalk/libdnet/commit/54a0c1440188a76f370b14d40777716a8761d0a8
---
libdnet-stripped/src/intf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libdnet-stripped/src/intf.c b/libdnet-stripped/src/intf.c
index 6180d85..4b282ff 100644
--- a/libdnet-stripped/src/intf.c
+++ b/libdnet-stripped/src/intf.c
@@ -774,7 +774,7 @@ _intf_get_aliases(intf_t *intf, struct intf_entry *entry)
u_int idx, bits, scope, flags;
if ((f = fopen(PROC_INET6_FILE, "r")) != NULL) {
- while (ap < lap &&
+ while ((ap + 1) < lap &&
fgets(buf, sizeof(buf), f) != NULL) {
/* scan up to INTF_NAME_LEN-1 bytes to reserve space for null terminator */
sscanf(buf, "%04s%04s%04s%04s%04s%04s%04s%04s %x %02x %02x %02x %15s\n",
--
2.33.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler/nmap.git
[email protected]:src-openeuler/nmap.git
src-openeuler
nmap
nmap
master

搜索帮助