]> granicus.if.org Git - php/commitdiff
Fixed NULL pointer dereference in ext/standard/tests/strings/setlocale_basic2.php
authorXinchen Hui <laruence@gmail.com>
Tue, 25 Feb 2014 04:09:39 +0000 (12:09 +0800)
committerXinchen Hui <laruence@gmail.com>
Tue, 25 Feb 2014 04:09:39 +0000 (12:09 +0800)
ext/standard/string.c

index af3c192f10bcd628aa43bb775f843a220d32aac2..33686b74e432ef451f34d1736f6b67fb9a70d5fa 100644 (file)
@@ -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];
                }