com php-src: Re-fixed #70895: Zend/tests/bug70895.phpt Zend/zend.c
| From: | Anatol Belski | Date: | Tue, 17 Nov 2015 12:05:14 +0000 |
| Subject: | com php-src: Re-fixed #70895: Zend/tests/bug70895.phpt Zend/zend.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-89926@lists.php.net to get a copy of this message | ||
Commit: 83bf7ec406dd96c3f4a9c34ba6c1ef96132ed9fa
Author: Xinchen Hui <laruence@gmail.com> Thu, 12 Nov 2015 14:35:34 +0800
Committer: Anatol Belski <ab@php.net> Tue, 17 Nov 2015 13:05:14 +0100
Parents: 3183ece929fd5f801ef714bebb84a72a74ddb0b9
Branches: PHP-7.0.0
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=83bf7ec406dd96c3f4a9c34ba6c1ef96132ed9fa
Log:
Re-fixed #70895
Bugs:
https://bugs.php.net/70895
Changed paths:
A Zend/tests/bug70895.phpt
M Zend/zend.c
Diff:
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);