summaryrefslogtreecommitdiff
path: root/testsuite/dc.tests
diff options
context:
space:
mode:
authorBrian Foley2019-09-05 10:53:21 +0200
committerDenys Vlasenko2019-09-05 10:53:21 +0200
commit10509a70ee5c28800d23bf891b4f72603447e364 (patch)
treea6a44ba6e4f4cc71257a6894494c62f827f0d7ce /testsuite/dc.tests
parentb64470be177314e8473fae6c32cab51cacb89fa7 (diff)
downloadbusybox-10509a70ee5c28800d23bf891b4f72603447e364.zip
busybox-10509a70ee5c28800d23bf891b4f72603447e364.tar.gz
dc: Parse error & fix out of bounds read in xc_program_printString
function old new delta xc_program_print 712 735 +23 Signed-off-by: Brian Foley <bpfoley@google.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'testsuite/dc.tests')
-rwxr-xr-xtestsuite/dc.tests20
1 files changed, 20 insertions, 0 deletions
diff --git a/testsuite/dc.tests b/testsuite/dc.tests
index 1fc13c2..361bc84 100755
--- a/testsuite/dc.tests
+++ b/testsuite/dc.tests
@@ -59,6 +59,26 @@ testing "dc: x should work with strings created from a" \
"42\n" \
"" ""
+testing "dc: p should print invalid escapes" \
+ "dc -e '[\q] p'" \
+ "\\q\n" \
+ "" ""
+
+testing "dc: p should print trailing backslashes" \
+ "dc -e '[q\] p'" \
+ "q\\\\\n" \
+ "" ""
+
+testing "dc: p should parse/print single backslashes" \
+ "dc -e '[\] p'" \
+ "\\\\\n" \
+ "" ""
+
+testing "dc: p should print single backslash strings" \
+ "dc -e '92 a p'" \
+ "\\\\\n" \
+ "" ""
+
testing "dc read" \
"dc -finput" \
"2\n9\n1\n" \