• Daniel P. Berrangé's avatar
    Ensure nul termination of hostname · d7684186
    Daniel P. Berrangé authored
    Newest GCC warns that the string copying is potentially truncated and
    thus not nul terminated.
    
    In file included from /usr/include/string.h:494,
                     from ../../src/Virt_HostSystem.c:23:
    In function ‘strncpy’,
        inlined from ‘resolve_host’ at ../../src/Virt_HostSystem.c:55:28,
        inlined from ‘get_fqdn’ at ../../src/Virt_HostSystem.c:92:23,
        inlined from ‘set_host_system_properties’ at ../../src/Virt_HostSystem.c:109:13:
    /usr/include/bits/string_fortified.h:106:10: error: ‘__builtin_strncpy’ specified bound 256 equals destination size [-Werror=stringop-truncation]
      106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
          |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    In function ‘strncpy’,
        inlined from ‘resolve_host’ at ../../src/Virt_HostSystem.c:67:17,
        inlined from ‘get_fqdn’ at ../../src/Virt_HostSystem.c:92:23,
        inlined from ‘set_host_system_properties’ at ../../src/Virt_HostSystem.c:109:13:
    /usr/include/bits/string_fortified.h:106:10: error: ‘__builtin_strncpy’ specified bound 256 equals destination size [-Werror=stringop-truncation]
      106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
          |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    cc1: all warnings being treated as errors
    Signed-off-by: 's avatarDaniel P. Berrangé <berrange@redhat.com>
    d7684186
Name
Last commit
Last update
base_schema Loading commit data...
doc Loading commit data...
examples Loading commit data...
libxkutil Loading commit data...
schema Loading commit data...
src Loading commit data...
tools Loading commit data...
.gitignore Loading commit data...
.gitpublish Loading commit data...
COPYING Loading commit data...
Makefile.am Loading commit data...
README Loading commit data...
acinclude.m4 Loading commit data...
autogen.sh Loading commit data...
configure.ac Loading commit data...
libvirt-cim.conf Loading commit data...
libvirt-cim.spec.in Loading commit data...
provider-register.sh Loading commit data...