diff options
author | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2022-12-29 09:57:59 -0300 |
---|---|---|
committer | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2023-01-11 17:50:12 -0300 |
commit | 0b3503e2e19602db9cda47915d19a26c00f59bb1 (patch) | |
tree | da4dcdc1ecfb519deebb70d28e051986a1d86c45 /sunrpc | |
parent | 57f4a850c84a0545dec9aea4242241d2b19fa6af (diff) | |
download | glibc-0b3503e2e19602db9cda47915d19a26c00f59bb1.zip glibc-0b3503e2e19602db9cda47915d19a26c00f59bb1.tar.gz glibc-0b3503e2e19602db9cda47915d19a26c00f59bb1.tar.bz2 |
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>
Diffstat (limited to 'sunrpc')
0 files changed, 0 insertions, 0 deletions