]> granicus.if.org Git - php/commitdiff
- MFB: Fixed crash when NULL is passed to locale_accept_from_http()
authorFelipe Pena <felipe@php.net>
Wed, 30 Jul 2008 17:56:18 +0000 (17:56 +0000)
committerFelipe Pena <felipe@php.net>
Wed, 30 Jul 2008 17:56:18 +0000 (17:56 +0000)
ext/intl/locale/locale_methods.c

index 60c6d19e990903d069711868b6b6be1fc9d5a11d..7ee16dd8a19f9166cd8ab8ce52504500298fd36e 100755 (executable)
@@ -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);