On 9/3/20 4:41 AM, Richard W.M. Jones wrote:
Previously with GCC 10.2 this code produced:In function ‘nbdkit_strndup_intern’, inlined from ‘nbdkit_strdup_intern’ at public.c:839:10: public.c:827:10: error: ‘strndup’ specified bound 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Werror=stringop-overflow=] 827 | copy = strndup (str, n); | ^~~~~~~~~~~~~~~~ --- server/public.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-)
I find the gcc warning annoying, but this workaround is fine (and potentially even a bit more efficient, because it uses fewer function calls).
ACK, regardless of whether gcc also agrees with your bug report. -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org _______________________________________________ Libguestfs mailing list [email protected] https://www.redhat.com/mailman/listinfo/libguestfs
