Project

General

Profile

Actions

Bug #683

closed

Build failure with GCC 10 / glibc 2.31: stringop-truncation in irc.c

Added by Adam Williamson almost 5 years ago. Updated over 4 years ago.

Status:
Resolved
Priority:
High
Assignee:
-
Target version:
Start date:
2020-02-07
Due date:
% Done:

0%

Estimated time:
Patch Available:
Yes
Found in Versions:
Confirmed:
No
Branch:
Security:
Help Needed:

Description

bip build failed with GCC 10 and glibc 2.31 (Fedora 32 mass rebuild). I'm attaching a patch suggested by DJ Delorie which fixes the build at least (didn't check yet that the built package works OK). Here's the build error:

gcc -DHAVE_CONFIG_H -I.     -Wall -Wextra -Werror -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=zEC12 -mtune=z13 -fasynchronous-unwind-tables -fstack-clash-protection -fPIE -Wno-unused-result -Wno-error=format-truncation -c -o libbip_a-irc.o `test -f 'irc.c' || echo './'`irc.c
In file included from /usr/include/string.h:495,
                 from irc.c:16:
In function 'strncpy',
    inlined from 'get_str_elem' at irc.c:646:3,
    inlined from 'irc_cli_startup.constprop' at irc.c:730:9:
/usr/include/bits/string_fortified.h:106:10: error: '__builtin_strncpy' output truncated before terminating nul copying as many bytes from a string as its length [-Werror=stringop-truncation]
  106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
irc.c: In function 'irc_cli_startup.constprop':
irc.c:642:13: note: length computed here
  642 |   c = str + strlen(str);
      |             ^~~~~~~~~~~
cc1: all warnings being treated as errors

Files

Actions

Also available in: Atom PDF