com php-src: Fixed bug #73532 (Null pointer dereference in mb_eregi): NEWS ext/mbstring/php_mbregex.c ext/ mbstring/tests/bug73532.phpt
| From: | Xinchen Hui | Date: | Wed, 16 Nov 2016 07:05:04 +0000 |
| Subject: | com php-src: Fixed bug #73532 (Null pointer dereference in mb_eregi): NEWS ext/mbstring/php_mbregex.c ext/ mbstring/tests/bug73532.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-95778@lists.php.net to get a copy of this message | ||
Commit: 229024c7250d0a11fe9a83094a7e30b6fb83ad90
Author: Xinchen Hui <laruence@gmail.com> Wed, 16 Nov 2016 15:05:04 +0800
Parents: d6c36e9af7ce43445b823e9a3b96868cf60fa7ed
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=229024c7250d0a11fe9a83094a7e30b6fb83ad90
Log:
Fixed bug #73532 (Null pointer dereference in mb_eregi)
Bugs:
https://bugs.php.net/73532
Changed paths:
M NEWS
M ext/mbstring/php_mbregex.c
A ext/mbstring/tests/bug73532.phpt
Diff:
diff --git a/NEWS b/NEWS
index 86d41c5..84c4f87 100644
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,9 @@ PHP NEWS
- Date:
. Fixed bug #69587 (DateInterval properties and isset). (jhdxr)
+- Mbstring:
+ . Fixed bug #73532 (Null pointer dereference in mb_eregi). (Laruence)
+
- SQLite3:
. Update to SQLite 3.15.1. (cmb)
diff --git a/ext/mbstring/php_mbregex.c b/ext/mbstring/php_mbregex.c
index a9e464f..cf341d3 100644
--- a/ext/mbstring/php_mbregex.c
+++ b/ext/mbstring/php_mbregex.c
@@ -708,8 +708,10 @@ static void _php_mb_regex_ereg_exec(INTERNAL_FUNCTION_PARAMETERS, int icase)
string_len,
_php_mb_regex_mbctype2name(MBREX(current_mbctype))
)) {
- zval_dtor(array);
- array_init(array);
+ if (array != NULL) {
+ zval_dtor(array);
+ array_init(array);
+ }
RETURN_FALSE;
}
diff --git a/ext/mbstring/tests/bug73532.phpt b/ext/mbstring/tests/bug73532.phpt
new file mode 100644
index 0000000..0bc838b
--- /dev/null
+++ b/ext/mbstring/tests/bug73532.phpt
@@ -0,0 +1,8 @@
+--TEST--
+Bug #73532 (Null pointer dereference in mb_eregi)
+--FILE--
+<?php
+var_dump(mb_eregi("a", "\xf5"));
+?>
+--EXPECTF--
+bool(false)