contiki/core/net
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
..
ip core/net/ip: Prevent (tiny) buffer overflow in resolv_found() 2014-10-02 12:52:39 +02:00
ipv4 Closing doxygen groups 2014-05-30 11:01:20 +02:00
ipv6 Insert properly Hop-by-Hop option at first hop 2014-06-27 09:45:51 +02:00
mac Merge pull request #635 from nfi/linkaddr-size 2014-06-11 23:18:27 +02:00
rime Changed the name of the rimeaddr module to linkaddr 2014-01-29 20:12:24 +01:00
rpl Improve RPL hop-by-hop option detection 2014-06-27 09:45:57 +02:00
linkaddr.c Changed the name of the rimeaddr module to linkaddr 2014-01-29 20:12:24 +01:00
linkaddr.h Changed the name of the rimeaddr module to linkaddr 2014-01-29 20:12:24 +01:00
nbr-table.c Changed the name of the rimeaddr module to linkaddr 2014-01-29 20:12:24 +01:00
nbr-table.h Changed the name of the rimeaddr module to linkaddr 2014-01-29 20:12:24 +01:00
netstack.c Added support for encryption and decryption of the packetbuf if macros 2012-11-25 12:05:00 +01:00
netstack.h Removed all old RCS tags in the Contiki source tree. Those RCS tags are not used any more, as we are now using git to manage the Contiki source tree 2012-10-26 15:54:49 +02:00
packetbuf.c Changed the name of the rimeaddr module to linkaddr 2014-01-29 20:12:24 +01:00
packetbuf.h Changed to use LINKADDR_SIZE instead of sizeof() to select between 2014-04-11 17:24:16 +02:00
packetqueue.c Removed all old RCS tags in the Contiki source tree. Those RCS tags are not used any more, as we are now using git to manage the Contiki source tree 2012-10-26 15:54:49 +02:00
packetqueue.h A massive all-tree automated update of all double inclusion guard #defines that changes from using two underscores as a prefix, which are reserved, to not using two underscores as a prefix 2013-11-24 20:20:11 +01:00
queuebuf.c Changed the name of the rimeaddr module to linkaddr 2014-01-29 20:12:24 +01:00
queuebuf.h Changed the name of the rimeaddr module to linkaddr 2014-01-29 20:12:24 +01:00