re PR java/7830 (Off-by-one buffer overruns in fastjar tool)

From greenrd@hotmail.com:
	* jartool.c (list_jar): Correctly determine when new `filename'
	buffer must be allocated.  Fixes PR java/7830.

From-SVN: r56818
This commit is contained in:
Tom Tromey 2002-09-04 22:40:55 +00:00 committed by Tom Tromey
parent 29984e05ae
commit a038cc83d6
2 changed files with 8 additions and 2 deletions

View 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.

View 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);