W3C home > Mailing lists > Public > public-webapps@w3.org > April to June 2009

Re: [widgets] Zip endian issue?

From: <Jere.Kapyaho@nokia.com>
Date: Fri, 3 Apr 2009 11:17:02 +0200
To: <marcosc@opera.com>, <public-webapps@w3.org>
CC: <timeless@gmail.com>
Message-ID: <C5FBAEBE.5932%jere.kapyaho@nokia.com>

the ZIP file specification does say that all values are stored in little-endian byte order unless otherwise specified. The local file header signature is the four bytes 50 4B 03 04, in this order, always. Endianness is not even an issue, if you read and compare individual bytes.

How could the ZIP file "be entirely transposed on media"? It is a binary file; if some entity is "transposing" it, it's not the same file anymore. A practical example of where and how this would be happening is needed.


On 3.4.2009 11.54, "ext Marcos Caceres" <marcosc@opera.com> wrote:

I recently chatted with Josh and he pointed out that there might be an
endian issue when checking for magic numbers.
timeless.bmo1@gmail.com:  zip files are guaranteed not to have ENDIAN issues?
If the first four bytes of the potential Zip archive do not match the
magic numbers for a Zip archive (50 4B 03 04)
 me:  ah, good point
 timeless.bmo1@gmail.com:  i.e. could you have 4B500403
or whatever the correct endian corruptions are :)
 me:  All values
 are stored in little-endian byte order unless otherwise specified.
 timeless.bmo1@gmail.com:  yeah, but could the file be entirely
transposed on media
test it.. create a zip file w/a single tiny file and then use some
perl magic to swap each pair of bytes :)
(i'm not awake enough to do that)
 me:  neither am I

Anyone with experience in this area want to propose some text for the
P&C spec to fix this issue.

Kind regards,
Marcos Caceres
Received on Friday, 3 April 2009 09:18:17 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:12:53 UTC