OSDN Git Service

* jcf-parse.c (parse_zip_file_entries): Overwrite trailing \0 of
authortromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 24 Jan 2003 02:37:34 +0000 (02:37 +0000)
committertromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 24 Jan 2003 02:37:34 +0000 (02:37 +0000)
file name in resource buffer.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@61694 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/java/ChangeLog
gcc/java/jcf-parse.c

index 3050610..0d084b4 100644 (file)
@@ -1,5 +1,10 @@
 2003-01-23  Tom Tromey  <tromey@redhat.com>
 
+       * jcf-parse.c (parse_zip_file_entries): Overwrite trailing \0 of
+       file name in resource buffer.
+
+2003-01-23  Tom Tromey  <tromey@redhat.com>
+
        * expr.c (build_known_method_ref): Use method's context to find
        method table index.
 
index 7545aa1..2f03202 100644 (file)
@@ -1221,7 +1221,9 @@ parse_zip_file_entries (void)
            buffer = ALLOC (zdir->filename_length + 1 +
                            (jcf->buffer_end - jcf->buffer));
            strcpy (buffer, file_name);
-           memcpy (buffer + zdir->filename_length + 1,
+           /* This is not a typo: we overwrite the trailing \0 of the
+              file name; this is just how the data is laid out.  */
+           memcpy (buffer + zdir->filename_length,
                    jcf->buffer, jcf->buffer_end - jcf->buffer);
 
            compile_resource_data (file_name, buffer,