From 1de25a6e87e0e627aa34298105a3d17c60a1f44e Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Mon, 26 Oct 2015 19:33:05 +0100 Subject: unzip: test for bad archive SEGVing function old new delta huft_build 1296 1300 +4 Signed-off-by: Denys Vlasenko --- testsuite/unzip.tests | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'testsuite') diff --git a/testsuite/unzip.tests b/testsuite/unzip.tests index 8677a0306..ca0a45800 100755 --- a/testsuite/unzip.tests +++ b/testsuite/unzip.tests @@ -7,7 +7,7 @@ . ./testing.sh -# testing "test name" "options" "expected result" "file input" "stdin" +# testing "test name" "commands" "expected result" "file input" "stdin" # file input will be file called "input" # test can create a file "actual" instead of writing to stdout @@ -30,6 +30,27 @@ testing "unzip (subdir only)" "unzip -q foo.zip foo/ && test -d foo && test ! -f rmdir foo rm foo.zip +# File containing some damaged encrypted stream +testing "unzip (bad archive)" "uudecode; unzip bad.zip 2>&1; echo \$?" \ +"Archive: bad.zip + inflating: ]3j½r«IK-%Ix +unzip: inflate error +1 +" \ +"" "\ +begin-base64 644 bad.zip +UEsDBBQAAgkIAAAAIQA5AAAANwAAADwAAAAQAAcAXTNqwr1ywqtJGxJLLSVJ +eCkBD0AdKBk8JzQsIj01JC0/ORJQSwMEFAECCAAAAAAhADoAAAAPAAAANgAA +AAwAAQASw73Ct1DCokohPXQiNjoUNTUiHRwgLT4WHlBLAQIQABQAAggIAAAA +oQA5AAAANwAAADwAAAAQQAcADAAAACwAMgCAAAAAAABdM2rCvXLCq0kbEkst +JUl4KQEPQB0oGSY4Cz4QNgEnJSYIPVBLAQIAABQAAggAAAAAIQAqAAAADwAA +BDYAAAAMAAEADQAAADIADQAAAEEAAAASw73Ct1DKokohPXQiNzA+FAI1HCcW +NzITNFBLBQUKAC4JAA04Cw0EOhZQSwUGAQAABAIAAgCZAAAAeQAAAAIALhM= +==== +" + +rm * + # Clean up scratch directory. cd .. -- cgit v1.2.3