summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Joye <pajoye@php.net>2010-10-19 09:56:11 +0000
committerPierre Joye <pajoye@php.net>2010-10-19 09:56:11 +0000
commitdefd00ab01e67026e11cbe70116e1ef4bbbd3a64 (patch)
tree5ad015f4004566647d2ad7c4d5c9a732f671b948
parentbaa6f7fc7107a4e053d58375e117ef2b5edbf887 (diff)
downloadphp-git-defd00ab01e67026e11cbe70116e1ef4bbbd3a64.tar.gz
- fix Fixed NULL pointer dereference in ZipArchive::getArchiveComment, (CVE-2010-3709), report&patch from Maksymilian Arciemowicz
-rw-r--r--ext/zip/php_zip.c3
1 files changed, 3 insertions, 0 deletions
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);
}
/* }}} */