glibc/stdio-common
Avinal Kumar 04e8698fcc stdio-common: Fix scanf parsing for NaN types [BZ #30647]
The scanf family of functions like sscanf and fscanf currently
ignore nan() and nan(n-char-sequence).  This happens because
__vfscanf_internal only checks for 'nan'.

This commit adds support for all valid nan types i.e.  nan, nan()
and nan(n-char-sequence), where n-char-sequence can be
[a-zA-Z0-9_]+, thus fixing the bug 30647.  Any other representation
of NaN should result in conversion error.

New tests are also added to verify the correct parsing of NaN types for
float, double and long double formats.

Signed-off-by: Avinal Kumar <avinal.xlvii@gmail.com>
Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2024-10-25 15:05:06 -03:00
..
bits
Depend
Makefile stdio-common: Fix scanf parsing for NaN types [BZ #30647] 2024-10-25 15:05:06 -03:00
Versions
Xprintf_buffer_done.c
Xprintf_buffer_flush.c
Xprintf_buffer_pad_1.c
Xprintf_buffer_putc_1.c
Xprintf_buffer_puts_1.c
Xprintf_buffer_write.c
Xprintf_function_invoke.c
_i18n_number.h
_itoa.c
_itowa.c
_itowa.h
asprintf.c
bug-vfprintf-nargs.c
bug1.c
bug1.input
bug2.c
bug3.c
bug4.c
bug5.c
bug6.c
bug6.input
bug7.c
bug8.c
bug9.c
bug10.c
bug11.c
bug12.c
bug13.c
bug14.c
bug16.c
bug17.c
bug18.c
bug18a.c
bug19.c
bug19a.c
bug20.c
bug21.c
bug22.c
bug23.c
bug24.c
bug25.c
bug26.c
bug27.c
bug28.c
bug29.c
ctermid.c
cuserid.c
dprintf.c
err_map.h
errlist-compat-data.h
errlist-data-gen.c
errlist-data.S
errlist.c
errname.c
errnobug.c
flockfile.c
fprintf.c
fscanf.c
ftrylockfile.c
funlockfile.c
fxprintf.c
gentempfd.c
getline.c
getw.c
grouping_iterator.c
grouping_iterator.h
iovfscanf.c
isoc23_fscanf.c
isoc23_scanf.c
isoc23_sscanf.c
isoc23_vfscanf.c
isoc23_vscanf.c
isoc23_vsscanf.c
isoc99_fscanf.c
isoc99_scanf.c
isoc99_sscanf.c
isoc99_vfscanf.c
isoc99_vscanf.c
isoc99_vsscanf.c
itoa-digits.c
itoa-udigits.c
itowa-digits.c
perror.c
printf-parse.h
printf-parsemb.c
printf-parsewc.c
printf-prs.c
printf.c
printf.h
printf_buffer-char.h
printf_buffer-wchar_t.h
printf_buffer_as_file.c
printf_buffer_as_file.h
printf_buffer_done.c
printf_buffer_flush.c
printf_buffer_pad_1.c
printf_buffer_putc_1.c
printf_buffer_puts_1.c
printf_buffer_to_file.c
printf_buffer_to_file.h
printf_buffer_write.c
printf_fp.c
printf_fphex.c
printf_function_invoke.c
printf_size.c
psiginfo-data.h
psiginfo-define.h
psiginfo.c
psignal.c
putw.c
reg-modifier.c
reg-printf.c
reg-type.c
remove.c
rename.c
renameat.c
renameat2.c
scanf.c
scanf1.c
scanf2.c
scanf3.c
scanf4.c
scanf5.c
scanf7.c
scanf8.c
scanf9.c
scanf10.c
scanf11.c
scanf12.c
scanf12.input
scanf13.c
scanf14.c
scanf15.c
scanf16.c
scanf17.c
scanf18.c
scanf19.c
siglist-gen.c
siglist.S
snprintf.c
sprintf.c
sscanf.c
stdio_ext.h
tempnam.c
tempname.c
temptest.c
test-fseek.c
test-fwrite.c
test-popen.c
test-strerr.c
test-vfprintf.c
test_rdwr.c
tfformat.c
tiformat.c
tllformat.c
tmpdir.c
tmpdir.h
tmpfile.c
tmpfile64.c
tmpnam.c
tmpnam_r.c
translated_number_width.c
tst-bz11319-fortify2.c
tst-bz11319.c
tst-cookie.c
tst-dprintf-length.c
tst-errno-manual.py
tst-fdopen.c
tst-fdopen2.c stdio-common: Add new test for fdopen 2024-09-26 15:33:03 +02:00
tst-ferror.c
tst-ferror.input
tst-fgets.c
tst-fgets2.c fgets: more tests 2024-09-04 16:24:12 -04:00
tst-fileno.c
tst-fmemopen.c
tst-fmemopen2.c
tst-fmemopen3.c
tst-fmemopen4.c
tst-fphex-wide.c
tst-fphex.c
tst-fread.c Add tests of fread 2024-09-24 14:06:22 +00:00
tst-freopen2-main.c Fix freopen handling of ,ccs= (bug 23675) 2024-09-05 20:08:10 +00:00
tst-freopen2.c Add more thorough tests of freopen 2024-09-04 16:32:21 +00:00
tst-freopen3-main.c Fix memory leak on freopen error return (bug 32140) 2024-09-05 11:16:59 +00:00
tst-freopen3.c Add more thorough tests of freopen 2024-09-04 16:32:21 +00:00
tst-freopen4-main.c stdio-common: Fix memory leak in tst-freopen4* tests on UNSUPPORTED 2024-09-28 21:06:11 +02:00
tst-freopen4.c Add freopen special-case tests: chroot, EFBIG, stdin/stdout/stderr 2024-09-20 23:26:31 +00:00
tst-freopen5.c Add freopen special-case tests: chroot, EFBIG, stdin/stdout/stderr 2024-09-20 23:26:31 +00:00
tst-freopen6-main.c Add freopen special-case tests: chroot, EFBIG, stdin/stdout/stderr 2024-09-20 23:26:31 +00:00
tst-freopen6.c Add freopen special-case tests: chroot, EFBIG, stdin/stdout/stderr 2024-09-20 23:26:31 +00:00
tst-freopen7-main.c Add freopen special-case tests: thread cancellation 2024-10-07 19:44:25 +00:00
tst-freopen7.c Add freopen special-case tests: thread cancellation 2024-10-07 19:44:25 +00:00
tst-freopen64-2.c Add more thorough tests of freopen 2024-09-04 16:32:21 +00:00
tst-freopen64-3.c Add more thorough tests of freopen 2024-09-04 16:32:21 +00:00
tst-freopen64-4.c Add freopen special-case tests: chroot, EFBIG, stdin/stdout/stderr 2024-09-20 23:26:31 +00:00
tst-freopen64-6.c Add freopen special-case tests: chroot, EFBIG, stdin/stdout/stderr 2024-09-20 23:26:31 +00:00
tst-freopen64-7.c Add freopen special-case tests: thread cancellation 2024-10-07 19:44:25 +00:00
tst-fseek.c
tst-fwrite-memstrm.c Add a new fwrite test for memory streams 2024-09-09 15:58:07 -03:00
tst-fwrite-overflow.c Add a new fwrite test that exercises buffer overflow 2024-09-30 15:57:12 -03:00
tst-fwrite-ro.c Add a new fwrite test for read-only streams 2024-09-09 14:32:20 -03:00
tst-fwrite.c
tst-getline-enomem.c Add more tests of getline 2024-08-21 19:58:14 +00:00
tst-getline.c Add more tests of getline 2024-08-21 19:58:14 +00:00
tst-gets.c
tst-gets.input
tst-grouping.c
tst-grouping2.c
tst-grouping3.c
tst-grouping_iterator.c
tst-long-dbl-fphex.c
tst-memstream-string.c
tst-obprintf.c
tst-perror.c
tst-popen.c
tst-popen2.c
tst-popen3.c
tst-printf-binary-main.c
tst-printf-binary.c
tst-printf-bz18872.sh
tst-printf-bz25691.c
tst-printf-fp-free.c
tst-printf-fp-leak.c
tst-printf-intn-main.c
tst-printf-intn.c
tst-printf-oct.c
tst-printf-round.c
tst-printf.c
tst-printf.sh
tst-printfsz-islongdouble.c
tst-printfsz-islongdouble.sh
tst-printfsz.c
tst-put-error.c
tst-renameat2.c support: Use macros for *stat wrappers 2024-08-16 16:05:20 +02:00
tst-rndseek.c
tst-scanf-binary-c11.c
tst-scanf-binary-c23.c
tst-scanf-binary-gnu11.c
tst-scanf-binary-gnu89.c
tst-scanf-binary-main.c
tst-scanf-bz27650.c
tst-scanf-intn-main.c
tst-scanf-intn.c
tst-scanf-nan.c stdio-common: Fix scanf parsing for NaN types [BZ #30647] 2024-10-25 15:05:06 -03:00
tst-scanf-round.c
tst-scanf-to_inpunct.c
tst-setvbuf1.c
tst-setvbuf1.expect
tst-sprintf-errno.c
tst-sprintf.c
tst-sprintf2.c
tst-sprintf3.c
tst-sscanf.c
tst-swprintf.c
tst-swscanf.c
tst-tmpnam.c
tst-unbputc.c
tst-unbputc.sh
tst-ungetc-leak.c ungetc: Fix backup buffer leak on program exit [BZ #27821] 2024-08-15 13:56:13 -04:00
tst-ungetc.c ungetc: Fix uninitialized read when putting into unused streams [BZ #27821] 2024-08-15 13:55:07 -04:00
tst-unlockedio.c
tst-vfprintf-mbs-prec.c
tst-vfprintf-user-type.c
tst-vfprintf-width-i18n.c
tst-vfprintf-width-prec-alloc.c
tst-vfprintf-width-prec.c
tst-wc-printf.c
tstdiomisc.c
tstgetln.c
tstgetln.input
tstscanf.c
tstscanf.input
vfprintf-internal.c
vfprintf-process-arg.c
vfprintf.c
vfscanf-internal.c stdio-common: Fix scanf parsing for NaN types [BZ #30647] 2024-10-25 15:05:06 -03:00
vfscanf.c
vfwprintf-internal.c
vfwprintf.c
vfwscanf-internal.c
vfwscanf.c
vprintf.c
wprintf_buffer_as_file.c
wprintf_buffer_done.c
wprintf_buffer_flush.c
wprintf_buffer_pad_1.c
wprintf_buffer_putc_1.c
wprintf_buffer_puts_1.c
wprintf_buffer_to_file.c
wprintf_buffer_write.c
wprintf_function_invoke.c
xbug.c