osd-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 Updated include paths for the moved files under net/ 2014-01-26 23:20:23 +01:00
dhcpc.h Moved all generic IP files into the net/ip module 2014-01-26 23:20:21 +01:00
psock.c Updated include paths for the moved files under net/ 2014-01-26 23:20:23 +01:00
psock.h Moved all generic IP files into the net/ip module 2014-01-26 23:20:21 +01:00
resolv.c core/net/ip: Prevent (tiny) buffer overflow in resolv_found() 2014-10-02 12:52:39 +02:00
resolv.h Moved all generic IP files into the net/ip module 2014-01-26 23:20:21 +01:00
simple-udp.c Updated include paths for the moved files under net/ 2014-01-26 23:20:23 +01:00
simple-udp.h Updated include paths for the moved files under net/ 2014-01-26 23:20:23 +01:00
slipdev.c Removed reliance on the core/net/ipv4 module 2014-01-26 23:20:37 +01:00
slipdev.h Moved all generic IP files into the net/ip module 2014-01-26 23:20:21 +01:00
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 Updated include paths for the moved files under net/ 2014-01-26 23:20:23 +01:00
tcpip.h Updated include paths for the moved files under net/ 2014-01-26 23:20:23 +01:00
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-debug.c Updated include paths for the moved files under net/ 2014-01-26 23:20:23 +01:00
uip-debug.h Updated include paths for the moved files under net/ 2014-01-26 23:20:23 +01:00
uip-packetqueue.c Updated include paths for the moved files under net/ 2014-01-26 23:20:23 +01:00
uip-packetqueue.h Moved all generic IP files into the net/ip module 2014-01-26 23:20:21 +01:00
uip-split.c Updated include paths for the moved files under net/ 2014-01-26 23:20:23 +01:00
uip-split.h Moved all generic IP files into the net/ip module 2014-01-26 23:20:21 +01:00
uip-udp-packet.c Implement multicast engine hooks in the uIPv6 core 2014-03-05 20:31:16 +00:00
uip-udp-packet.h Updated include paths for the moved files under net/ 2014-01-26 23:20:23 +01:00
uip.h Merge pull request #696 from sieben/doc 2014-07-28 11:42:41 +02:00
uip_arch.h Updated include paths for the moved files under net/ 2014-01-26 23:20:23 +01:00
uiplib.c Updated include paths for the moved files under net/ 2014-01-26 23:20:23 +01:00
uiplib.h Updated include paths for the moved files under net/ 2014-01-26 23:20:23 +01:00
uipopt.h Moved all generic IP files into the net/ip module 2014-01-26 23:20:21 +01:00