A while ago, I wrote a small Go app that reads things from zip files.  I 
tested it with various zip files (usually Java jar files), and it has 
always worked perfectly fine.

Today I'm looking at another jar file.  The Java "jar" command likes it 
perfectly fine. I could list the contents and extract all the files. Java 
had no particular trouble running with the jar file.

When I try to call "zip.OpenReader()" on this jar file, it just gives me 
""zip: not a valid zip file"".  Well, great.

I then ran a command to run the same command on every jar file in my home 
directory tree, where there are a couple of thousand from various tool 
distributions.  I counted how many failed with that same error. I found 
just the one I already have.

This jar file is a little over 12mb.  Several of the jar files that don't 
fail are quite a bit larger than this. Most of the ones that don't fail are 
smaller than this. The permissions on this jar are the same as the others.

I then tried passing this jar file to "unzip". It was able to unzip it, but 
it did print this:

    warning [<jar file name>]:  3624 extra bytes at beginning or within 
zipfile
      (attempting to process anyway)

I tried this on some of the working jar files, and it didn't print this 
warning.

So, it appears that if anything, this jar file is "nonstandard", but both 
unzip and jar have no problem with it, and jar didn't even say there was an 
issue with it.  The zip package, however, bombs on this with no information.

I'm going to go to the people who gave me that jar file and ask them how 
they produced it, but I think it's clear it's not fatally broken.

I haven't submitted a bug report for this package yet, as I wanted some 
feedback on this first.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/3a235738-3ce0-4357-8c78-870fc61c8829n%40googlegroups.com.

Reply via email to