From a038cc83d66e70c608995e066de22ced97b8ad38 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Wed, 4 Sep 2002 22:40:55 +0000 Subject: 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 --- fastjar/ChangeLog | 6 ++++++ fastjar/jartool.c | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'fastjar') diff --git a/fastjar/ChangeLog b/fastjar/ChangeLog index 42cc98a..6528dd0 100644 --- a/fastjar/ChangeLog +++ b/fastjar/ChangeLog @@ -1,3 +1,9 @@ +2002-09-04 Tom Tromey + + 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 * configure.in: Support cross-compiling. diff --git a/fastjar/jartool.c b/fastjar/jartool.c index 2436606..7251185 100644 --- a/fastjar/jartool.c +++ b/fastjar/jartool.c @@ -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); -- cgit v1.1