]> granicus.if.org Git - libnl/commit
route/inet6: fix strncpy() in inet6_dump_details()
authorThomas Haller <thaller@redhat.com>
Fri, 9 Aug 2019 14:18:08 +0000 (16:18 +0200)
committerThomas Haller <thaller@redhat.com>
Fri, 9 Aug 2019 14:48:55 +0000 (16:48 +0200)
commit8d40ab198df60a250623fbc4d0787b715a6dc4bd
treef1faae4638a725ed686577cfb9ecb13b36e76ebd
parent77ae25aad1901633b6c7c6e0561d053e6e6391c0
route/inet6: fix strncpy() in inet6_dump_details()

Compiler warnings:

  lib/route/link/inet6.c: In function ‘inet6_dump_details’:
  lib/route/link/inet6.c:383:3: error: ‘strncpy’ output may be truncated copying between 0 and 63 bytes from a string of length 63 [-Werror=stringop-truncation]
    383 |   strncpy(&buf[offset], buf2, strlen(buf2));
        |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Also, passing "strlen(buf2)" as length argument to strncpy() is
certainly wrong.
lib/route/link/inet6.c