Commit a038cc83 by Tom Tromey Committed by Tom Tromey

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
parent 29984e05
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.
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment