diff options
author | Tom Tromey <tromey@redhat.com> | 2003-01-24 02:37:34 +0000 |
---|---|---|
committer | Tom Tromey <tromey@gcc.gnu.org> | 2003-01-24 02:37:34 +0000 |
commit | 8bef0925e831b8b5092b6282cb5d8b68dad62cc0 (patch) | |
tree | 1b2a15c0f3c85e90b27c730da2aafc09574e410e /gcc/java/jcf-parse.c | |
parent | b48624772c2e05eac9dff8d9353697a96a99bb1b (diff) | |
download | gcc-8bef0925e831b8b5092b6282cb5d8b68dad62cc0.zip gcc-8bef0925e831b8b5092b6282cb5d8b68dad62cc0.tar.gz gcc-8bef0925e831b8b5092b6282cb5d8b68dad62cc0.tar.bz2 |
jcf-parse.c (parse_zip_file_entries): Overwrite trailing \0 of file name in resource buffer.
* jcf-parse.c (parse_zip_file_entries): Overwrite trailing \0 of
file name in resource buffer.
From-SVN: r61694
Diffstat (limited to 'gcc/java/jcf-parse.c')
-rw-r--r-- | gcc/java/jcf-parse.c | 4 |
1 files changed, 3 insertions, 1 deletions
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, |