From 251fc70e9722f931eec23a34030d05ba5f747b0e Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Thu, 18 Aug 2011 14:29:41 +0200 Subject: uncompress: fix buffer underrun by corrupted input Signed-off-by: Denys Vlasenko --- testsuite/uncompress.tests | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 testsuite/uncompress.tests (limited to 'testsuite/uncompress.tests') 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 @@ +#!/bin/sh +# Copyright 2011 by Denys Vlasenko +# Licensed under GPLv2, see file LICENSE in this source tree. + +. ./testing.sh + +# testing "test name" "commands" "expected result" "file input" "stdin" + +testing "uncompress < \x1f\x9d\x90 \x01 x N" \ +'uncompress 2>&1 1>/dev/null; echo $?' \ +"\ +uncompress: corrupted data +1 +" \ +"" "\ +\x1f\x9d\x90\ +\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\ +" + +exit $FAILCOUNT -- cgit v1.2.3