aboutsummaryrefslogtreecommitdiff
path: root/tests/sed.test
diff options
context:
space:
mode:
authorAndy Chu <andychup@gmail.com>2016-03-06 09:49:50 -0800
committerRob Landley <rob@landley.net>2016-03-10 13:59:32 -0600
commit96a5ed118ce8ad1aaf7889b9eff599bb4517aa49 (patch)
treebc3c58c9f62aed2fdaf9aaaa6747016cfd415b62 /tests/sed.test
parent1fd80657b06e016217efb7068b08fa9e4aa5650d (diff)
downloadtoybox-96a5ed118ce8ad1aaf7889b9eff599bb4517aa49.tar.gz
Fix segfault in sed -e 'c\'.
Found by afl-fuzz.
Diffstat (limited to 'tests/sed.test')
-rwxr-xr-xtests/sed.test3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/sed.test b/tests/sed.test
index 280b466a..ec06baae 100755
--- a/tests/sed.test
+++ b/tests/sed.test
@@ -77,6 +77,9 @@ testing "c {range}" "sed -e '2,4{c blah' -e '}'" \
"" "one\ntwo\nthree\nfour\nfive\nsix"
testing "c multiple continuation" \
"sed -e 'c\\' -e 'two\\' -e ''" "two\n\n" "" "hello"
+# NOTE: will print 'unfinished c' to stderr and exit 1
+testing "c empty continuation" \
+ "sed -e 'c\\'" "" "" "hello"
testing "D further processing depends on whether line is blank" \
"sed -e '/one/,/three/{' -e 'i meep' -e'N;2D;}'" \
"meep\nmeep\ntwo\nthree\n" "" "one\ntwo\nthree\n"