From: Pierre Joye Date: Tue, 19 Oct 2010 09:56:11 +0000 (+0000) Subject: - fix Fixed NULL pointer dereference in ZipArchive::getArchiveComment, (CVE-2010... X-Git-Tag: php-5.4.0alpha1~191^2~782 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=defd00ab01e67026e11cbe70116e1ef4bbbd3a64;p=php - fix Fixed NULL pointer dereference in ZipArchive::getArchiveComment, (CVE-2010-3709), report&patch from Maksymilian Arciemowicz --- 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); } /* }}} */