]> gcc.gnu.org Git - gcc.git/commitdiff
re PR java/7830 (Off-by-one buffer overruns in fastjar tool)
authorTom Tromey <tromey@redhat.com>
Wed, 4 Sep 2002 22:40:55 +0000 (22:40 +0000)
committerTom Tromey <tromey@gcc.gnu.org>
Wed, 4 Sep 2002 22:40:55 +0000 (22:40 +0000)
From greenrd@hotmail.com:
* jartool.c (list_jar): Correctly determine when new `filename'
buffer must be allocated.  Fixes PR java/7830.

From-SVN: r56818

fastjar/ChangeLog
fastjar/jartool.c

index 42cc98ab390492ff5931945bf297653ee4cd59c4..6528dd0437f8b26a6c532da72a6661ec3a9aff66 100644 (file)
@@ -1,3 +1,9 @@
+2002-09-04  Tom Tromey  <tromey@redhat.com>
+
+       From greenrd@hotmail.com:
+       * jartool.c (list_jar): Correctly determine when new `filename'
+       buffer must be allocated.  Fixes PR java/7830.
+
 2002-06-03  Geoffrey Keating  <geoffk@redhat.com>
 
        * configure.in: Support cross-compiling.
index 2436606d5026e970d8508a33e9a5c2458797c082..7251185d61f7156d0a04e77f94cb75746e460875 100644 (file)
@@ -1657,7 +1657,7 @@ int list_jar(int fd, char **files, int file_num){
         strftime(ascii_date, 30, "%a %b %d %H:%M:%S %Z %Y", s_tm);
       }
 
-      if(filename_len < fnlen){
+      if(filename_len < fnlen + 1){
         if(filename != NULL)
           free(filename);
       
@@ -1776,7 +1776,7 @@ int list_jar(int fd, char **files, int file_num){
         strftime(ascii_date, 30, "%a %b %d %H:%M:%S %Z %Y", s_tm);
       }
 
-      if(filename_len < fnlen){
+      if(filename_len < fnlen + 1){
         if(filename != NULL)
           free(filename);
         
This page took 0.062074 seconds and 5 git commands to generate.