From defd00ab01e67026e11cbe70116e1ef4bbbd3a64 Mon Sep 17 00:00:00 2001 From: Pierre Joye Date: Tue, 19 Oct 2010 09:56:11 +0000 Subject: [PATCH] - 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(+) diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c index c1b1c95a31..522e92d34f 100644 --- a/ext/zip/php_zip.c +++ b/ext/zip/php_zip.c @@ -1974,6 +1974,9 @@ static ZIPARCHIVE_METHOD(getArchiveComment) } comment = zip_get_archive_comment(intern, &comment_len, (int)flags); + if(comment==NULL) { + RETURN_FALSE; + } RETURN_STRINGL((char *)comment, (long)comment_len, 1); } /* }}} */ -- 2.40.0