This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch: FYI: fastjar -x bug fix


This fixes a buglet in fastjar unpacking.
It comes from Red Hat bugzilla:

http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=74106

fastjar wasn't correctly handling extra data in the header during
extraction.  The "list" code worked fine.

Tom

Index: ChangeLog
from  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.

Index: jartool.c
===================================================================
RCS file: /cvs/gcc/gcc/fastjar/jartool.c,v
retrieving revision 1.29
diff -u -r1.29 jartool.c
--- jartool.c 19 Jul 2004 20:41:03 -0000 1.29
+++ jartool.c 23 Sep 2004 23:35:05 -0000
@@ -1805,8 +1805,10 @@
       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 @@
         printf("%d bytes written\n", out_a);
 #endif
       }
-
-        consume(&pbf, eflen);
     }
 
     /* if there is a data descriptor left, compare the CRC */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]