From f45752eb8393ebe758d8e920f7a48a2a39aa6ea5 Mon Sep 17 00:00:00 2001 From: Xinchen Hui Date: Tue, 9 Feb 2016 23:32:20 +0800 Subject: [PATCH 1/2] Fixed bug #71561 (NULL pointer dereference in Zip::ExtractTo) --- NEWS | 3 +++ ext/zip/php_zip.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 0fc0565798e..a13c4b2d54f 100644 --- a/NEWS +++ b/NEWS @@ -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: diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c index d040d206d1a..ccd0467fd35 100644 --- a/ext/zip/php_zip.c +++ b/ext/zip/php_zip.c @@ -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; } } From aeb5319336aa447ad24968479b8aa249dd4c43a7 Mon Sep 17 00:00:00 2001 From: Xinchen Hui Date: Tue, 9 Feb 2016 23:36:15 +0800 Subject: [PATCH 2/2] Update NEWS --- NEWS | 3 +++ 1 file changed, 3 insertions(+) diff --git a/NEWS b/NEWS index 7b1023f961a..d15eb75458e 100644 --- a/NEWS +++ b/NEWS @@ -39,6 +39,9 @@ PHP NEWS - XMLRPC: . Fixed bug #71501 (xmlrpc_encode_request ignores encoding option). (Hieu Le) +- Zip: + . Fixed bug #71561 (NULL pointer dereference in Zip::ExtractTo). (Laruence) + 04 Feb 2016 PHP 7.0.3 - Core: