]> granicus.if.org Git - php/commitdiff
MFB: Fix the setlocale() segfault
authorRasmus Lerdorf <rasmus@php.net>
Wed, 2 Apr 2003 21:33:02 +0000 (21:33 +0000)
committerRasmus Lerdorf <rasmus@php.net>
Wed, 2 Apr 2003 21:33:02 +0000 (21:33 +0000)
ext/standard/string.c

index 371a72eb7d8680145ca8eab1dec5a7c479fd812f..9aac0a26746b6006f741763650214980a3db98f3 100644 (file)
@@ -3377,6 +3377,7 @@ PHP_FUNCTION(setlocale)
        }
        while (1) {
                if (Z_TYPE_PP(args[1]) == IS_ARRAY) {
+                       if(!zend_hash_num_elements(Z_ARRVAL_PP(args[1]))) break;
                        zend_hash_get_current_data(Z_ARRVAL_PP(args[1]),(void **)&plocale);
                } else {
                        plocale = args[i];