From: Felipe Pena Date: Wed, 30 Jul 2008 16:43:11 +0000 (+0000) Subject: - Fixed crash when NULL is passed to locale_accept_from_http() X-Git-Tag: php-5.3.0alpha1~39 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fcd87bc3a119127938031089f010f183105d986b;p=php - Fixed crash when NULL is passed to locale_accept_from_http() --- diff --git a/ext/intl/locale/locale_methods.c b/ext/intl/locale/locale_methods.c index 75cebb2f86..1584f54c1d 100755 --- a/ext/intl/locale/locale_methods.c +++ b/ext/intl/locale/locale_methods.c @@ -1668,7 +1668,7 @@ PHP_FUNCTION(locale_accept_from_http) &outResult, http_accept, available, &status); uenum_close(available); INTL_CHECK_STATUS(status, "locale_accept_from_http: failed to find acceptable locale"); - if(outResult == ULOC_ACCEPT_FAILED) { + if (len < 0 || outResult == ULOC_ACCEPT_FAILED) { RETURN_FALSE; } RETURN_STRINGL(resultLocale, len, 1);