glibc/locale/programs
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
..
3level.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
charmap-dir.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
charmap-dir.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
charmap-kw.gperf Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
charmap-kw.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
charmap.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
charmap.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
config.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
ld-address.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
ld-collate.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
ld-ctype.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
ld-identification.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
ld-measurement.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
ld-messages.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
ld-monetary.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
ld-name.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
ld-numeric.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
ld-paper.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
ld-telephone.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
ld-time.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
linereader.c locale: Use correct buffer size for utf8_sequence_error [BZ #19444] 2023-01-11 17:50:12 -03:00
linereader.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
locale-spec.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
locale.c Update copyright dates not handled by scripts/update-copyrights 2023-01-06 21:45:36 +00:00
localedef.c Update copyright dates not handled by scripts/update-copyrights 2023-01-06 21:45:36 +00:00
localedef.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
locarchive.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
locfile-kw.gperf Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
locfile-kw.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
locfile-token.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
locfile.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
locfile.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
record-status.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
record-status.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
repertoire.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
repertoire.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
simple-hash.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
simple-hash.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
xasprintf.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
xmalloc.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
xstrdup.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00