Files
coreutils/tests/cut
Pádraig Brady 0a1a7f9022 cut: fix NUL termination of multi-byte field delimiter
* src/cut.c (delim_bytes): Add a spare byte so a maximum-length
multi-byte delimiter stays NUL terminated for the strstr needle in
find_field_delim.  Note in 9.11 this buffer was larger (16 bytes)
and so didn't not have a buffer over-read issue.
(main): Ensure DELIM_BYTES is NUL terminated after each --delimeter.
Also explicitly writing the NUL allows for better testing by
triggering overflow issues in default builds, if the buffer
is not sized correctly.
* NEWS: Mention the bug fix.
* tests/cut/cut.pl: Add test cases.
Reported at https://github.com/coreutils/coreutils/pull/286
2026-06-10 13:50:04 +01:00
..