From: Felipe Pena Date: Wed, 30 Jul 2008 17:56:18 +0000 (+0000) Subject: - MFB: Fixed crash when NULL is passed to locale_accept_from_http() X-Git-Tag: BEFORE_HEAD_NS_CHANGE~953 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=39a1c0e86d4a48034bab4a1621459e9cef940d2c;p=php - MFB: 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 60c6d19e99..7ee16dd8a1 100755 --- a/ext/intl/locale/locale_methods.c +++ b/ext/intl/locale/locale_methods.c @@ -1692,7 +1692,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);