mirror of
https://github.com/nmap/nmap.git
synced 2025-12-06 12:41:29 +00:00
Use correct width in sscanf. Fixes #1156
This commit is contained in:
@@ -2392,3 +2392,19 @@ Index: configure.in
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
dnl Checks for typedefs, structures, and compiler characteristics.
|
dnl Checks for typedefs, structures, and compiler characteristics.
|
||||||
|
|
||||||
|
o Ensure we read 1 byte less than buffer size to allow for automatically-appended null char.
|
||||||
|
|
||||||
|
diff --git a/libdnet-stripped/src/arp-ioctl.c b/libdnet-stripped/src/arp-ioctl.c
|
||||||
|
index 434142e..31b9f8c 100644
|
||||||
|
--- a/libdnet-stripped/src/arp-ioctl.c
|
||||||
|
+++ b/libdnet-stripped/src/arp-ioctl.c
|
||||||
|
@@ -218,7 +218,7 @@ arp_loop(arp_t *a, arp_handler callback, void *arg)
|
||||||
|
|
||||||
|
ret = 0;
|
||||||
|
while (fgets(buf, sizeof(buf), fp) != NULL) {
|
||||||
|
- i = sscanf(buf, "%s 0x%x 0x%x %100s %100s %100s\n",
|
||||||
|
+ i = sscanf(buf, "%s 0x%x 0x%x %99s %99s %99s\n",
|
||||||
|
ipbuf, &type, &flags, macbuf, maskbuf, devbuf);
|
||||||
|
|
||||||
|
if (i < 4 || (flags & ATF_COM) == 0)
|
||||||
|
|||||||
@@ -218,7 +218,7 @@ arp_loop(arp_t *a, arp_handler callback, void *arg)
|
|||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
while (fgets(buf, sizeof(buf), fp) != NULL) {
|
while (fgets(buf, sizeof(buf), fp) != NULL) {
|
||||||
i = sscanf(buf, "%s 0x%x 0x%x %100s %100s %100s\n",
|
i = sscanf(buf, "%s 0x%x 0x%x %99s %99s %99s\n",
|
||||||
ipbuf, &type, &flags, macbuf, maskbuf, devbuf);
|
ipbuf, &type, &flags, macbuf, maskbuf, devbuf);
|
||||||
|
|
||||||
if (i < 4 || (flags & ATF_COM) == 0)
|
if (i < 4 || (flags & ATF_COM) == 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user