selinux/libselinux
Christian Göttsche 0cdaf73c08 libselinux: make use of strndup
Using strndup(3) instead of malloc(3) followed by strncpy(3) simplifies
the code and pleases GCC:

    In file included from /usr/include/string.h:535,
                     from context.c:2:
    In function ‘strncpy’,
        inlined from ‘context_new’ at context.c:74:3:
    /usr/include/x86_64-linux-gnu/bits/string_fortified.h:95:10: error: ‘__builtin_strncpy’ destination unchanged after copying no bytes [-Werror=stringop-truncation]
       95 |   return __builtin___strncpy_chk (__dest, __src, __len,
          |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       96 |                                   __glibc_objsize (__dest));
          |                                   ~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
Acked-by: James Carter <jwcart2@gmail.com>
2022-11-23 08:22:40 -05:00
..
include libselinux: declare parameter of security_load_policy(3) const 2022-06-15 08:58:48 -04:00
man libselinux: declare parameter of security_load_policy(3) const 2022-06-15 08:58:48 -04:00
src libselinux: make use of strndup 2022-11-23 08:22:40 -05:00
utils libselinux: simplify string copying 2022-11-21 14:29:21 -05:00
LICENSE initial import from svn trunk revision 2950 2008-08-19 15:30:36 -04:00
Makefile libselinux: use PCRE2 by default 2021-12-09 11:07:00 -05:00
VERSION Update VERSIONs to 3.4 for release. 2022-05-18 16:51:03 +02:00