contiki/core/net/ip
Joakim Gebart 24d15ad9a5 core/net/ip: Prevent (tiny) buffer overflow in resolv_found()
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>
2014-10-02 12:52:39 +02:00
..
dhcpc.c
dhcpc.h
psock.c
psock.h
resolv.c core/net/ip: Prevent (tiny) buffer overflow in resolv_found() 2014-10-02 12:52:39 +02:00
resolv.h
simple-udp.c
simple-udp.h
slipdev.c Removed reliance on the core/net/ipv4 module 2014-01-26 23:20:37 +01:00
slipdev.h
tcp-socket.c The TCP socket API code 2014-03-24 08:42:28 +01:00
tcp-socket.h The TCP socket API code 2014-03-24 08:42:28 +01:00
tcpip.c
tcpip.h
udp-socket.c The UDP socket API code 2014-03-24 08:42:13 +01:00
udp-socket.h The UDP socket API code 2014-03-24 08:42:13 +01:00
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 Implement multicast engine hooks in the uIPv6 core 2014-03-05 20:31:16 +00:00
uip-udp-packet.h
uip.h Merge pull request #696 from sieben/doc 2014-07-28 11:42:41 +02:00
uiplib.c
uiplib.h
uipopt.h