]> granicus.if.org Git - php/commitdiff
@- Fixed an infinite loop in setlocale() when only invalid locale names
authorAndrei Zmievski <andrei@php.net>
Fri, 18 Oct 2002 13:07:50 +0000 (13:07 +0000)
committerAndrei Zmievski <andrei@php.net>
Fri, 18 Oct 2002 13:07:50 +0000 (13:07 +0000)
@  were passed in the array. (patch by Pal Loberg, pallo@initio.no).

ext/standard/string.c

index 80d55eec3824684db9c6a183ec0758152976c0d6..ddd0bce2e93c63a009fc0935a53f47b0f8033525 100644 (file)
@@ -3225,7 +3225,7 @@ PHP_FUNCTION(setlocale)
                }
                
                if (Z_TYPE_PP(args[1]) == IS_ARRAY) {
-                       zend_hash_move_forward(Z_ARRVAL_PP(args[1]));
+                       if (zend_hash_move_forward(Z_ARRVAL_PP(args[1])) == FAILURE) break;
                } else {
                        if (++i >= n_args) break;
                }