summaryrefslogtreecommitdiff
path: root/tests/misc/csplit
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2003-11-16 11:52:08 +0000
committerJim Meyering <jim@meyering.net>2003-11-16 11:52:08 +0000
commit8560d7254ba1cbf29f5b6941e65c1619c01b33a6 (patch)
treea293bbbf232364ba8119a50fe2b8338f8bfdbccf /tests/misc/csplit
parent26c47da032b305a84be2d33068ab349ee2f39b38 (diff)
downloadcoreutils-8560d7254ba1cbf29f5b6941e65c1619c01b33a6.tar.xz
Add test to detect this.
This would fail due to reading from freed buffer with coreutils-5.0.91.
Diffstat (limited to 'tests/misc/csplit')
-rwxr-xr-xtests/misc/csplit8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/misc/csplit b/tests/misc/csplit
index b0cb1faae..2d04fee7f 100755
--- a/tests/misc/csplit
+++ b/tests/misc/csplit
@@ -36,6 +36,14 @@ cmp out exp || fail=1
test $fail = 1 && diff out exp 2> /dev/null
rm -f in out exp
+# Ensure that xx02 contains just two newlines.
+# This would fail due to reading from freed buffer with coreutils-5.0.91.
+printf '\n\n' > exp
+cp xx02 out || fail=1
+cmp out exp || fail=1
+test $fail = 1 && diff out exp 2> /dev/null
+rm -f in out exp
+
# csplit would infloop
(echo; echo a) > in
csplit in '/a/-1' '{*}' > out || fail=1