Fixed bug #71561 (NULL pointer dereference in Zip::ExtractTo)

This commit is contained in:
Xinchen Hui 2016-02-09 23:32:20 +08:00
parent 5fdfab743d
commit f45752eb83
2 changed files with 4 additions and 1 deletions

3
NEWS
View File

@ -20,6 +20,9 @@ PHP NEWS
- Standard:
. Fixed bug #70720 (strip_tags improper php code parsing). (Julien)
- Zip:
. Fixed bug #71561 (NULL pointer dereference in Zip::ExtractTo). (Laruence)
04 Feb 2016, PHP 5.6.18
- Core:

View File

@ -2713,7 +2713,7 @@ static ZIPARCHIVE_METHOD(extractTo)
for (i = 0; i < filecount; i++) {
char *file = (char*)zip_get_name(intern, i, ZIP_FL_UNCHANGED);
if (!php_zip_extract_file(intern, pathto, file, strlen(file) TSRMLS_CC)) {
if (!file || !php_zip_extract_file(intern, pathto, file, strlen(file) TSRMLS_CC)) {
RETURN_FALSE;
}
}