glibc/locale
Adhemerval Zanella 0b3503e2e1 locale: Use correct buffer size for utf8_sequence_error [BZ #19444]
The buffer used by snprintf might not be large enough for all possible
inputs, as indicated by gcc with -O1:

../locale/programs/linereader.c: In function ‘utf8_sequence_error’:
../locale/programs/linereader.c:713:58: error: ‘%02x’ directive output
may be truncated writing between 2 and 8 bytes into a region of size
between 1 and 13 [-Werror=format-truncation=]
  713 |     snprintf (buf, sizeof (buf), "0x%02x 0x%02x 0x%02x 0x%02x",
      |                                                          ^~~~
../locale/programs/linereader.c:713:34: note: directive argument in the
range [0, 2147483647]
  713 |     snprintf (buf, sizeof (buf), "0x%02x 0x%02x 0x%02x 0x%02x",
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../locale/programs/linereader.c:713:5: note: ‘snprintf’ output between
20 and 38 bytes into a destination of size 30
  713 |     snprintf (buf, sizeof (buf), "0x%02x 0x%02x 0x%02x 0x%02x",
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  714 |               ch1, ch2, ch3, ch4);
      |               ~~~~~~~~~~~~~~~~~~~

Checked on x86_64-linux-gnu.
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2023-01-11 17:50:12 -03:00
..
bits Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
programs locale: Use correct buffer size for utf8_sequence_error [BZ #19444] 2023-01-11 17:50:12 -03:00
tst-localedef-path-norm.root localedef: Add verbose messages for failure paths. 2020-04-26 13:55:58 -04:00
broken_cur_max.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
C_name.c Update. 2001-04-06 17:49:18 +00:00
C-address.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
C-collate-seq.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
C-collate.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
C-ctype.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
C-identification.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
C-measurement.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
C-messages.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
C-monetary.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
C-name.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
C-numeric.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
C-paper.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
C-telephone.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
C-time.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
C-translit.h.in Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
categories.def Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
coll-lookup.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
coll-lookup.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
duplocale.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
elem-hash.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
findlocale.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
freelocale.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
gen-translit.py Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
global-locale.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
hashval.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
indigits.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
indigitswc.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
iso-639.def Add rif_MA locale [BZ #27781] 2022-04-07 14:59:41 +02:00
iso-3166.def Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
iso-4217.def Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
langinfo.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
lc-address.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
lc-collate.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
lc-ctype.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
lc-identification.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
lc-measurement.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
lc-messages.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
lc-monetary.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
lc-name.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
lc-numeric.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
lc-paper.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
lc-telephone.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
lc-time.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
loadarchive.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
loadlocale.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
locale.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
localeconv.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
localeinfo.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
localename.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
locarchive.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
Makefile Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
mb_cur_max.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
newlocale.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
nl_langinfo_l.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
nl_langinfo.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
outdigits.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
outdigitswc.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
setlocale.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
strlen-hash.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
SYS_libc.c [BZ #284, BZ #721] 2005-02-17 01:19:55 +00:00
tst-C-locale.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
tst-duplocale.c Add missing test files. 2009-11-17 16:23:57 -08:00
tst-locale-locpath.sh Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
tst-localedef-path-norm.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
tst-locname.c Add missing test files. 2009-11-17 16:23:57 -08:00
uselocale.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
Versions * sysdeps/ia64/dl-fptr.c (__ia64_make_fptr): Revert last change. 2003-03-03 09:45:25 +00:00
weight.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
weightwc.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
xlocale.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00