aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/java/ChangeLog5
-rw-r--r--gcc/java/jcf-parse.c4
2 files changed, 8 insertions, 1 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index 3050610..0d084b4 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -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.
diff --git a/gcc/java/jcf-parse.c b/gcc/java/jcf-parse.c
index 7545aa1..2f03202 100644
--- a/gcc/java/jcf-parse.c
+++ b/gcc/java/jcf-parse.c
@@ -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,