jartool.c (extract_jar): Unconditionally read extra data in the entry header...
authorTom Tromey <tromey@redhat.com>
Thu, 23 Sep 2004 23:40:33 +0000 (23:40 +0000)
committerTom Tromey <tromey@gcc.gnu.org>
Thu, 23 Sep 2004 23:40:33 +0000 (23:40 +0000)
* jartool.c (extract_jar): Unconditionally read extra data in the
entry header; don't read it after the file contents.

From-SVN: r87990

fastjar/ChangeLog
fastjar/jartool.c

index 56538111880f65668d30462d02ad2b5b6edfc17b..609b33905732dd284049132ac4cdecab2a8deadf 100644 (file)
@@ -1,3 +1,8 @@
+2004-09-23  Tom Tromey  <tromey@redhat.com>
+
+       * jartool.c (extract_jar): Unconditionally read extra data in the
+       entry header; don't read it after the file contents.
+
 2004-08-11  Kelley Cook  <kcook@gcc.gnu.org>
 
        PR bootstrap/16164
index f43af14a62da19e5b9667d13cfe1e6e3bb93b69a..9431bb5e0a243607ab0881416c6d55a384843cfc 100644 (file)
@@ -1805,8 +1805,10 @@ int extract_jar(int fd, char **files, int file_num){
       exit(1);
     }
 
+    if (eflen > 0)
+      consume(&pbf, eflen);
+
     if(method == 8 || flags & 0x0008){
-        consume(&pbf, eflen);
       
       inflate_file(&pbf, f_fd, &ze);
     } else {
@@ -1839,8 +1841,6 @@ int extract_jar(int fd, char **files, int file_num){
         printf("%d bytes written\n", out_a);
 #endif
       }
-
-        consume(&pbf, eflen);
     }
 
     /* if there is a data descriptor left, compare the CRC */