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

index 75cebb2f865f1b1aee3d685554987249c7f5b638..1584f54c1dc3bdc0b66e0556a8ba3e9701203a5e 100755 (executable)
@@ -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);