mirror of
https://github.com/oliverschmidt/contiki.git
synced 2024-08-16 22:28:59 +00:00
An off-by-one error in resolv_found() could make an strncat() call overflow by the terminating null byte. When building with Clang the following warning was shown: ../../../core/net/ip/resolv.c:1458:17: warning: the value of the size argument in 'strncat' is too large, might lead to a buffer overflow [-Wstrncat-size] sizeof(resolv_hostname) - strlen(resolv_hostname)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../../core/net/ip/resolv.c:1458:17: note: change the argument to be the free space in the destination buffer minus the terminating null byte sizeof(resolv_hostname) - strlen(resolv_hostname)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sizeof(resolv_hostname) - strlen(resolv_hostname) - 1 Signed-off-by: Joakim Gebart <joakim.gebart@eistec.se> |
||
---|---|---|
.. | ||
dhcpc.c | ||
dhcpc.h | ||
psock.c | ||
psock.h | ||
resolv.c | ||
resolv.h | ||
simple-udp.c | ||
simple-udp.h | ||
slipdev.c | ||
slipdev.h | ||
tcp-socket.c | ||
tcp-socket.h | ||
tcpip.c | ||
tcpip.h | ||
udp-socket.c | ||
udp-socket.h | ||
uip_arch.h | ||
uip-debug.c | ||
uip-debug.h | ||
uip-packetqueue.c | ||
uip-packetqueue.h | ||
uip-split.c | ||
uip-split.h | ||
uip-udp-packet.c | ||
uip-udp-packet.h | ||
uip.h | ||
uiplib.c | ||
uiplib.h | ||
uipopt.h |