diff --git a/libdnet-stripped/NMAP_MODIFICATIONS b/libdnet-stripped/NMAP_MODIFICATIONS index 3d716f237..43c1047b9 100644 --- a/libdnet-stripped/NMAP_MODIFICATIONS +++ b/libdnet-stripped/NMAP_MODIFICATIONS @@ -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) diff --git a/libdnet-stripped/src/arp-ioctl.c b/libdnet-stripped/src/arp-ioctl.c index 434142e5a..31b9f8c8c 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)