]> git.ipfire.org Git - thirdparty/glibc.git/commit
locale: Fix --enable-ubsan build failure on some ABIs
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Wed, 30 Apr 2025 17:24:20 +0000 (14:24 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Wed, 7 May 2025 13:41:34 +0000 (10:41 -0300)
commit8ab4aa30e54192ac9506ff4ea5cc189da5299e28
tree9030ff323dd37a0b1b0100313c7390f506fcf409
parentf13e58f9b120791c7585f60ab126ed922a319cd1
locale: Fix --enable-ubsan build failure on some ABIs

On mips, arc, powerpc, and s390 gcc 14 triggers the warning

In function ‘charmap_new_char’,
    inlined from ‘parse_charmap.isra’ at ../locale/programs/charmap.c:570:6:
../locale/programs/charmap.c:1017:32: error: ‘strncmp’ specified bound [21474836494294967295] exceeds maximum object size 2147483647 [-Werror=stringop-overread]
 1017 |   if (cp == &from[len1 - 1] || strncmp (from, to, prefix_len) != 0)
      |                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../locale/programs/charmap.c:1017:32: error: ‘strncmp’ specified bound [21474836494294967295] exceeds maximum object size 2147483647 [-Werror=stringop-overread]
cc1: all warnings being treated as errors

So move the case to an special function and disable the sanitizer.
locale/programs/charmap.c
locale/programs/charmap.h
locale/programs/repertoire.c