diff options
author | Elliott Hughes <enh@google.com> | 2019-12-22 19:18:29 -0800 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2019-12-22 23:10:43 -0600 |
commit | 35ee6fcf9ff0d5bb4fef39557f8fe4e9d8b8937e (patch) | |
tree | 5b6348fb2428f2f26d6e6a88fbcdc339e7a640b8 /tests | |
parent | 488f8507dcf4f634952f4f649e7a95d219468b83 (diff) | |
download | toybox-35ee6fcf9ff0d5bb4fef39557f8fe4e9d8b8937e.tar.gz |
gzip: reject non-gzip files in zlib path.
It turns out that zlib defaults to just copying data verbatim if the
input isn't in gzip format, rather than rejecting it. Explicitly add a
check that zlib isn't doing that. (The toybox inflation path already
errors out.)
Also add the missing test.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/gzip.test | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/gzip.test b/tests/gzip.test index 24bd01ed..b458307e 100644 --- a/tests/gzip.test +++ b/tests/gzip.test @@ -76,3 +76,6 @@ testing "permissions/times preservation" \ "gzip -k f1 && TZ=UTC stat -c '%a %Y' f1 && stat -c '%a %X %Y' f1.gz" \ "411 544413660\n411 252558240 544413660\n" "" "" rm -f f1 f1.gz + +testing "reject non-gzip" "gzip -dc $FILES/blkid/msdos.bz2 2>/dev/null || + echo rejected" "rejected\n" "" "" |