From 80bea6534863413d80a23fe58913b73fc8333086 Mon Sep 17 00:00:00 2001 From: Pierre Joye Date: Tue, 19 Oct 2010 09:55:36 +0000 Subject: - fix Fixed NULL pointer dereference in ZipArchive::getArchiveComment, (CVE-2010-3709), report&patch from Maksymilian Arciemowicz --- ext/zip/php_zip.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'ext/zip/php_zip.c') diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c index c2adccf8a1..a6d317de0f 100644 --- a/ext/zip/php_zip.c +++ b/ext/zip/php_zip.c @@ -1954,6 +1954,9 @@ static ZIPARCHIVE_METHOD(getCommentIndex) PHP_ZIP_STAT_INDEX(intern, index, 0, sb); comment = zip_get_file_comment(intern, index, &comment_len, (int)flags); + if(comment==NULL) { + RETURN_FALSE; + } RETURN_STRINGL((char *)comment, (long)comment_len, 1); } /* }}} */ -- cgit v1.2.1