[BusyBox 0001575]: Newer unzip.c doesn't compile with arm-linux-gnu-gcc, bad header structure size.

bugs at busybox.net bugs at busybox.net
Mon Nov 5 17:10:07 PST 2007


A NOTE has been added to this issue. 
====================================================================== 
http://busybox.net/bugs/view.php?id=1575 
====================================================================== 
Reported By:                dserpell
Assigned To:                BusyBox
====================================================================== 
Project:                    BusyBox
Issue ID:                   1575
Category:                   Other
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     assigned
====================================================================== 
Date Submitted:             11-05-2007 07:53 PST
Last Modified:              11-05-2007 17:10 PST
====================================================================== 
Summary:                    Newer unzip.c doesn't compile with
arm-linux-gnu-gcc, bad header structure size.
Description: 
Compiling using arm-linux-gnu-gcc, (Debian etch version):

-----------------------------------------------------------
CC      archival/unzip.o
archival/unzip.c:61: error: size of array
‘BUG_zip_header_must_be_26_bytes’ is negative
make[1]: *** [archival/unzip.o] Error 1
-----------------------------------------------------------

In fact, the structure size is 28 bytes.

Gcc is:
-----------------------------------------------------------
 arm-linux-gnu-gcc -v
Using built-in specs.
Target: arm-linux-gnu
Configured with: ../src/configure -v --enable-languages=c,c++
--prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib
--without-included-gettext --enable-threads=posix --enable-nls
--with-gxx-include-dir=/usr/arm-linux-gnu/include/c++/4.1.2
--program-suffix=-4.1 --enable-__cxa_atexit --enable-clocale=gnu
--enable-libstdcxx-debug --enable-checking=release
--program-prefix=arm-linux-gnu- --includedir=/usr/arm-linux-gnu/include
--build=i486-linux-gnu --host=i486-linux-gnu --target=arm-linux-gnu
Thread model: posix
gcc version 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)
-----------------------------------------------------------

I created a small test sample (attached), running it gives:
-----------------------------------------------------------
Size: 28
Fields:
 version:       0  (0)
 flags:         2  (2)
 method:        4  (4)
 modtime:       6  (6)
 moddate:       8  (8)
 crc32:        10 (10)
 cmpsize:      14 (14)
 ucmpsize:     18 (18)
 filename_len: 22 (22)
 extra_len:    24 (24)
-----------------------------------------------------------
This means that only the structure size is incorrect.

====================================================================== 

---------------------------------------------------------------------- 
 dserpell - 11-05-07 10:51  
---------------------------------------------------------------------- 
I added a patch fixing compilation of unzip.c. I tested the resulting
binary on the target, unzipping some files, and it works. 

---------------------------------------------------------------------- 
 vda - 11-05-07 17:10  
---------------------------------------------------------------------- 
So you just saw how useful is to have sanity checks against idiotic
compilers, and you are... removing it? Do you want next victim to have
silently miscompiled binaries? 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
11-05-07 07:53  dserpell       New Issue                                    
11-05-07 07:53  dserpell       Status                   new => assigned     
11-05-07 07:53  dserpell       Assigned To               => BusyBox         
11-05-07 07:53  dserpell       File Added: testStruct.c                     
11-05-07 10:50  dserpell       File Added: busybox-unzip.patch                  
 
11-05-07 10:51  dserpell       Note Added: 0002890                          
11-05-07 17:10  vda            Note Added: 0002892                          
======================================================================



More information about the busybox-cvs mailing list