1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-04-21 03:12:48 +02:00

csplit: avoid buffer overrun when writing more than 999 files

Without this fix, seq 1000 | csplit - /./ '{*}' would write
the NUL-terminated file name, xx1000, into a buffer of size 6.
* src/csplit.c (main): Use properly sized file name buffer.
* NEWS (Bug fixes): Mention it.
* tests/misc/csplit-1000: New test to trigger the bug.
* tests/Makefile.am (TESTS): Add misc/csplit-1000.
This commit is contained in:
Jim Meyering
2010-11-10 13:53:38 +01:00
parent 425503c807
commit 0cfd4f2161
4 changed files with 39 additions and 4 deletions

View File

@@ -172,6 +172,7 @@ TESTS = \
misc/chroot-fail \
misc/comm \
misc/csplit \
misc/csplit-1000 \
misc/date-sec \
misc/dircolors \
misc/df \