From: Rasmus Lerdorf Date: Wed, 2 Apr 2003 21:33:02 +0000 (+0000) Subject: MFB: Fix the setlocale() segfault X-Git-Tag: RELEASE_0_5~192 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1612ffad059b11dfa55c9f6692b637b9849be677;p=php MFB: Fix the setlocale() segfault --- diff --git a/ext/standard/string.c b/ext/standard/string.c index 371a72eb7d..9aac0a2674 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -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];