diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:00:48 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:00:48 +0000 |
commit | 851b6a097165af4d51c0db01b5e05256e5006896 (patch) | |
tree | 5f7c388ec894a7806c49a99f3bdb605d0b299a7c /test/integration/test-github-111-invalid-armember | |
parent | Initial commit. (diff) | |
download | apt-851b6a097165af4d51c0db01b5e05256e5006896.tar.xz apt-851b6a097165af4d51c0db01b5e05256e5006896.zip |
Adding upstream version 2.6.1.upstream/2.6.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rwxr-xr-x | test/integration/test-github-111-invalid-armember | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/test/integration/test-github-111-invalid-armember b/test/integration/test-github-111-invalid-armember new file mode 100755 index 0000000..2340321 --- /dev/null +++ b/test/integration/test-github-111-invalid-armember @@ -0,0 +1,34 @@ +#!/bin/sh +set -e + +TESTDIR="$(readlink -f "$(dirname "$0")")" +. "$TESTDIR/framework" +setupenvironment +configarchitecture "amd64" +setupaptarchive + +# this used to crash, but it should treat it as an invalid member header +touch ' ' +testsuccess ar -q test.deb ' ' +testsuccessequal "E: Invalid archive member header" ${APTTESTHELPERSBINDIR}/testdeb test.deb + + +rm test.deb +touch 'x' +testsuccess ar -q test.deb 'x' +testsuccessequal "E: This is not a valid DEB archive, missing 'debian-binary' member" ${APTTESTHELPERSBINDIR}/testdeb test.deb + + +# <name><size> [ other fields] - name is not nul terminated here, it ends in . +msgmsg "Unterminated ar member name" +printf '!<arch>\0120123456789ABCDE.A123456789A.01234.01234.0123456.012345678.0.' > test.deb +testsuccessequal "E: Invalid archive member header" ${APTTESTHELPERSBINDIR}/testdeb test.deb + + +${APTTESTHELPERSBINDIR}/createdeb-cve-2020-27350 github-111 control.tar +gzip control.tar +cp control.tar.gz data.tar.gz +touch debian-binary +rm test.deb +testsuccess ar -q test.deb debian-binary control.tar.gz data.tar.gz +testsuccessequal "W: Unknown TAR header type 88" ${APTTESTHELPERSBINDIR}/testdeb test.deb |