com php-src: Avoid NULL pointer dereferencing: ext/standard/string.c
| From: | Dmitry Stogov | Date: | Fri, 19 Dec 2014 15:20:55 +0000 |
| Subject: | com php-src: Avoid NULL pointer dereferencing: ext/standard/string.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-83805@lists.php.net to get a copy of this message | ||
Commit: ffc49acabc3e331022c4e9423cf85f6bb900da20
Author: Dmitry Stogov <dmitry@zend.com> Fri, 19 Dec 2014 18:20:55 +0300
Parents: 4514ba016ff158cd113deef1a215fcdcb6913b48
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=ffc49acabc3e331022c4e9423cf85f6bb900da20
Log:
Avoid NULL pointer dereferencing
Changed paths:
M ext/standard/string.c
Diff:
diff --git a/ext/standard/string.c b/ext/standard/string.c
index 419fef3..2668161 100644
--- a/ext/standard/string.c
+++ b/ext/standard/string.c
@@ -4274,7 +4274,11 @@ PHP_FUNCTION(setlocale)
zend_string_release(loc);
}
- RETURN_STR(zend_string_copy(BG(locale_string)));
+ if (BG(locale_string)) {
+ RETURN_STR(zend_string_copy(BG(locale_string)));
+ } else {
+ RETURN_EMPTY_STRING();
+ }
}
zend_string_release(loc);