com php-src: Fixed NULL pointer dereference in ext/standard/tes ts/strings/setlocale_basic2.php: ext/standard/string .c
| From: | Dmitry Stogov | Date: | Tue, 25 Feb 2014 04:09:39 +0000 |
| Subject: | com php-src: Fixed NULL pointer dereference in ext/standard/tes ts/strings/setlocale_basic2.php: ext/standard/string .c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-77959@lists.php.net to get a copy of this message | ||
Commit: e0a32353af0ba610cf1677bf74ecfeddc2aa8cd6
Author: Xinchen Hui <laruence@gmail.com> Tue, 25 Feb 2014 12:09:39 +0800
Parents: ff162410f09526d0caa6d977f07b63de373ff7ef
Branches: phpng
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=e0a32353af0ba610cf1677bf74ecfeddc2aa8cd6
Log:
Fixed NULL pointer dereference in ext/standard/tests/strings/setlocale_basic2.php
Changed paths:
M ext/standard/string.c
Diff:
diff --git a/ext/standard/string.c b/ext/standard/string.c
index af3c192..33686b7 100644
--- a/ext/standard/string.c
+++ b/ext/standard/string.c
@@ -4331,7 +4331,9 @@ PHP_FUNCTION(setlocale)
if (!zend_hash_num_elements(Z_ARRVAL(args[0]))) {
break;
}
- plocale = zend_hash_get_current_data(Z_ARRVAL(args[0]));
+ if ((plocale = zend_hash_get_current_data(Z_ARRVAL(args[0]))) == NULL) {
+ break;
+ }
} else {
plocale = &args[i];
}