diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2011-08-18 14:29:41 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2011-08-18 14:29:41 +0200 |
commit | 251fc70e9722f931eec23a34030d05ba5f747b0e (patch) | |
tree | f35f23afd72b5d527f6c011745981c9bdd9ec3a6 /testsuite | |
parent | b1611d9a4693f1dc8296ef44f7e0f6044032ce15 (diff) | |
download | busybox-w32-251fc70e9722f931eec23a34030d05ba5f747b0e.tar.gz busybox-w32-251fc70e9722f931eec23a34030d05ba5f747b0e.tar.bz2 busybox-w32-251fc70e9722f931eec23a34030d05ba5f747b0e.zip |
uncompress: fix buffer underrun by corrupted input
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'testsuite')
-rwxr-xr-x | testsuite/uncompress.tests | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/testsuite/uncompress.tests b/testsuite/uncompress.tests new file mode 100755 index 000000000..51a233493 --- /dev/null +++ b/testsuite/uncompress.tests | |||
@@ -0,0 +1,20 @@ | |||
1 | #!/bin/sh | ||
2 | # Copyright 2011 by Denys Vlasenko | ||
3 | # Licensed under GPLv2, see file LICENSE in this source tree. | ||
4 | |||
5 | . ./testing.sh | ||
6 | |||
7 | # testing "test name" "commands" "expected result" "file input" "stdin" | ||
8 | |||
9 | testing "uncompress < \x1f\x9d\x90 \x01 x N" \ | ||
10 | 'uncompress 2>&1 1>/dev/null; echo $?' \ | ||
11 | "\ | ||
12 | uncompress: corrupted data | ||
13 | 1 | ||
14 | " \ | ||
15 | "" "\ | ||
16 | \x1f\x9d\x90\ | ||
17 | \01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\ | ||
18 | " | ||
19 | |||
20 | exit $FAILCOUNT | ||