New upstream version 1.8
[debian/gzip] / tests / unpack-invalid
1 #!/bin/sh
2 # gzip should report invalid 'unpack' input when uncompressing.
3 # With gzip-1.5, it would output invalid data instead.
4
5 # Copyright (C) 2012-2016 Free Software Foundation, Inc.
6
7 # This program is free software: you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation, either version 3 of the License, or
10 # (at your option) any later version.
11
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 # GNU General Public License for more details.
16
17 # You should have received a copy of the GNU General Public License
18 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
19 # limit so don't run it by default.
20
21 . "${srcdir=.}/init.sh"; path_prepend_ ..
22
23 for input in \
24   '\037\036\000\000\037\213\010\000\000\000\000\000\002\003\036\000\000\000\002\003\037\213\010\000\000\000\000\000\002\003\355\301\001\015\000\000\000\302\240\037\000\302\240\037\213\010\000\000\000\000\000\002\003\355\301' \
25   '\037\213\010\000\000\000\000\000\002\003\355\301\001\015\000\000\000\302\240\076\366\017\370\036\016\030\000\000\000\000\000\000\000\000\000\034\010\105\140\104\025\020\047\000\000\037\036\016\030\000\000\000'; do
26
27   printf "$input" >in || framework_failure_
28
29   if gzip -d <in >out 2>err; then
30     fail=1
31   else
32     fail=0
33   fi
34 done
35
36 Exit $fail