summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelipe Pena <felipe@php.net>2008-07-30 16:43:11 +0000
committerFelipe Pena <felipe@php.net>2008-07-30 16:43:11 +0000
commitfcd87bc3a119127938031089f010f183105d986b (patch)
tree4a7fcef225e7fad9a411fe642455ddaa12632236
parent2f469e8c15d856ecee876343aa29f40c0d011526 (diff)
downloadphp-git-fcd87bc3a119127938031089f010f183105d986b.tar.gz
- Fixed crash when NULL is passed to locale_accept_from_http()
-rwxr-xr-xext/intl/locale/locale_methods.c2
1 files changed, 1 insertions, 1 deletions
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);