Am 01.05.2017 um 22:40 schrieb Grant Edwards:
> The Busybox 'unzip' utility returns a failure status and prints an
> error message when it's given an properly formatted (but empty) zip
> archive.
> 
>    $ hexdump -C empty.zip
>    00000000  50 4b 05 06 00 00 00 00  00 00 00 00 00 00 00 00  
> |PK..............|
>    00000010  00 00 00 00 00 00                                 |......|
>    00000016
>    
>    $ file empty.zip
>    empty.zip: Zip archive data (empty)
>    
>    $ busybox unzip empty.zip || echo FAIL
>    Archive:  empty.zip
>    unzip: invalid zip magic 06054B50
>    FAIL
> 
> Why is that an error?

Just to give you a short answer (without having fixed the issue yet):

At the point of error (unzip.c:656) busybox is not prepared to handle a
Central-Directory-End-Magic (0x06054B50), but the ZIP-File seems valid [0].

It should be easy to catch the signature there and just stop processing.
But as I'm new to this code, I don't know if there are any side-effects.


[0] https://www.iana.org/assignments/media-types/application/zip
    See "General Format of a ZIP file" - everything is optional
    except a CDE at EOF (which may also be BOF if no other parts are
    present)

-- 
    \\\||///
  \\  - -  //
   (  @ @  )
-oOo--( )--oOo-------------------------------------------------------
 tiggersWelt.net                                 www.tiggersWelt.net
 Inhaber Bernd Holzmüller                       i...@tiggerswelt.net
                                            Büro: 07 11 / 550 425-90
 Marktstraße 57                              Fax: 07 11 / 550 425-99
 70372 Stuttgart

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to