1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-06 04:31:29 +00:00

Use correct width in sscanf. Fixes #1156

This commit is contained in:
dmiller
2018-03-22 16:31:32 +00:00
parent 19ba6060db
commit 36a6d897a5
2 changed files with 17 additions and 1 deletions

View File

@@ -2392,3 +2392,19 @@ Index: configure.in
fi
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)

View File

@@ -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)