1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-12-06 12:01:08 +03:00
Files
glibc/libio/iogetdelim.c
Collin Funk 33eff78c8b libio: Add terminating NUL when the first character is EOF in getdelim [BZ #28038]
POSIX requires that the buffer used by getdelim/getline add a
terminating NUL whenever an EOF is read.

* libio/iogetdelim.c (__getdelim): Add a NUL byte when the first
__underflow is called.
* libio/tst-getdelim.c (do_test): Add a test case for the bug.

Reviewed-by: Florian Weimer <fweimer@redhat.com>
2025-10-09 17:38:01 -07:00

3.6 KiB