com php-src: Re-fixed #70895: NEWS Zend/tests/bug70895.phpt Zend/zend.c

From: Date: Thu, 12 Nov 2015 06:35:34 +0000
Subject: com php-src: Re-fixed #70895: NEWS Zend/tests/bug70895.phpt Zend/zend.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-89767@lists.php.net to get a copy of this message
Commit: 53c03115cfe81780f6ec5647b5d75f01fb8511f5 Author: Xinchen Hui <laruence@gmail.com> Thu, 12 Nov 2015 14:35:34 +0800 Parents: 2bed2152e6a31f0666cdb7c707f150bc42a86885 Branches: PHP-7.0 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=53c03115cfe81780f6ec5647b5d75f01fb8511f5 Log: Re-fixed #70895 Bugs: https://bugs.php.net/70895 Changed paths: M NEWS A Zend/tests/bug70895.phpt M Zend/zend.c Diff: diff --git a/NEWS b/NEWS index 77c0010..3ac684a 100644 --- a/NEWS +++ b/NEWS @@ -4,7 +4,7 @@ PHP NEWS - Core: . Fixed bug #70895 (null ptr deref and segfault with crafted calable). - (Anatol) + (Anatol, Laruence) - Streams/Socket . Add IPV6_V6ONLY constant / make it usable in stream contexts. (Bob) diff --git a/Zend/tests/bug70895.phpt b/Zend/tests/bug70895..phpt new file mode 100644 index 0000000..e6df09c --- /dev/null +++ b/Zend/tests/bug70895.phpt @@ -0,0 +1,15 @@ +--TEST-- +Bug #70895 null ptr deref and segfault with crafted calable +--FILE-- +<?php + +array_map("%n", 0); +array_map("%n %i", 0); +array_map("%n %i aoeu %f aoeu %p", 0); +?> +--EXPECTREGEX-- +Warning: array_map\(\) expects parameter 1 to be a valid callback, function '%n' not found or invalid function name in .+ + +Warning: array_map\(\) expects parameter 1 to be a valid callback, function '%n %i' not found or invalid function name in .+ + +Warning: array_map\(\) expects parameter 1 to be a valid callback, function '%n %i aoeu %f aoeu %p' not found or invalid function name in .+bug70895.php on line \d+ diff --git a/Zend/zend.c b/Zend/zend.c index 27e8070...ab14372 100644 --- a/Zend/zend.c +++ b/Zend/zend.c @@ -1346,7 +1346,7 @@ ZEND_API ZEND_COLD void zend_internal_type_error(zend_bool throw_exception, cons if (throw_exception) { zend_throw_exception(zend_ce_type_error, message, 0); } else { - zend_error(E_WARNING, message); + zend_error(E_WARNING, "%s", message); } efree(message);

« previous php.cvs (#89767) next »