jcf-parse.c (parse_zip_file_entries): Overwrite trailing \0 of file name in resource...
authorTom Tromey <tromey@redhat.com>
Fri, 24 Jan 2003 02:37:34 +0000 (02:37 +0000)
committerTom Tromey <tromey@gcc.gnu.org>
Fri, 24 Jan 2003 02:37:34 +0000 (02:37 +0000)
* jcf-parse.c (parse_zip_file_entries): Overwrite trailing \0 of
file name in resource buffer.

From-SVN: r61694

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

index 3050610a29169decc790084fe9e5f4fb254ac3da..0d084b4222461a1ffa7fda3f3e9ef0a021bd7ed6 100644 (file)
@@ -1,3 +1,8 @@
+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
index 7545aa18efaade26a726265b60a669fa92e3401f..2f03202d5dd3dc5313b6e8c04148190955d8bcc0 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,