jcf-path.c (jcf_path_init): Allocate 1 more byte for string.
authorH.J. Lu <hjl@gnu.org>
Sat, 8 Jun 2002 16:34:39 +0000 (16:34 +0000)
committerH.J. Lu <hjl@gcc.gnu.org>
Sat, 8 Jun 2002 16:34:39 +0000 (09:34 -0700)
2002-06-08  H.J. Lu  (hjl@gnu.org)

* jcf-path.c (jcf_path_init): Allocate 1 more byte for string.

From-SVN: r54384

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

index 10a4746a8d095c6468afd8d5ad6993ccc6af516d..9dab4a5ebd87fb639bfd954aeb84525fe37f783d 100644 (file)
@@ -1,3 +1,7 @@
+2002-06-08  H.J. Lu  (hjl@gnu.org)
+
+       * jcf-path.c (jcf_path_init): Allocate 1 more byte for string.
+
 2002-06-04  Tom Tromey  <tromey@redhat.com>
 
        * jcf-write.c (perform_relocations): Optmize a goto to a goto.
index a87703e5ac02caa70c916fddba228e36c73478aa..b68a538f45b7ba73881c3316335dfadd94a02dc3 100644 (file)
@@ -305,7 +305,7 @@ jcf_path_init ()
       /* Desperation: use the installed one.  */
       char *extdirs;
       add_entry (&sys_dirs, LIBGCJ_ZIP_FILE, 1);
-      extdirs = (char *) alloca (strlen (LIBGCJ_ZIP_FILE));
+      extdirs = (char *) alloca (strlen (LIBGCJ_ZIP_FILE) + 1);
       strcpy (extdirs, LIBGCJ_ZIP_FILE);
       strcpy (&extdirs[strlen (LIBGCJ_ZIP_FILE)
                      - strlen ("libgcj-" DEFAULT_TARGET_VERSION ".jar")],