ofalk / libdnet

libdnet provides a simplified, portable interface to several low-level networking routines.
Other
153 stars 60 forks source link

arp-ioctl.c:221: 3 * off by one error #71

Closed dcb314 closed 2 years ago

dcb314 commented 2 years ago

Static analyser cppcheck says:

arp-ioctl.c:221:7: error: Width 100 given in format string (no. 4) is larger than destination buffer 'macbuf[100]', use %99s to prevent overflowing it. [invalidScanfFormatWidth] arp-ioctl.c:221:7: error: Width 100 given in format string (no. 5) is larger than destination buffer 'maskbuf[100]', use %99s to prevent overflowing it. [invalidScanfFormatWidth] arp-ioctl.c:221:7: error: Width 100 given in format string (no. 6) is larger than destination buffer 'devbuf[100]', use %99s to prevent overflowing it. [invalidScanfFormatWidth] route-linux.c:223:8: error: Width 16 given in format string (no. 1) is larger than destination buffer 'ifbuf[16]', use %15s to prevent overflowing it. [invalidScanfFormatWidth]

ofalk commented 2 years ago

This is already fixed in the devel branch with commit 661c7286 .