From 5c2d34512114ad76b5a6934cd22f3f577509b65a Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sat, 10 Sep 2005 14:06:29 +0000 Subject: [PATCH] Add test for the bug fixed today. --- tests/misc/csplit | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/misc/csplit b/tests/misc/csplit index 5ea8a6a..740df9e 100755 --- a/tests/misc/csplit +++ b/tests/misc/csplit @@ -86,4 +86,13 @@ EOF cmp err experr || fail=1 test $fail = 1 && diff err experr 2> /dev/null +# Ensure that lines longer than the initial buffer length don't cause +# trouble (e.g. reading from freed memory, resulting in corrupt output). +# This test failed at least in coreutils-5.2.1 and 5.3.0, and was fixed +# in 5.3.1. +rm -f in out exp err experr xx?? +printf 'x%8199s\nx\n%8199s\nx\n' x x > in +csplit in '/x/' '{*}' > /dev/null || fail=1 +cat xx?? | cmp - in || fail=1 + (exit $fail); exit $fail -- 2.7.4