diff --git a/ext/intl/locale/locale_methods.c b/ext/intl/locale/locale_methods.c index d9eb91c659b..a61aebfb367 100644 --- a/ext/intl/locale/locale_methods.c +++ b/ext/intl/locale/locale_methods.c @@ -1259,7 +1259,7 @@ PHP_FUNCTION(locale_filter_matches) if( boolCanonical ){ /* canonicalize loc_range */ can_loc_range=get_icu_value_internal( loc_range , LOC_CANONICALIZE_TAG , &result , 0); - if( result ==0) { + if( result <=0) { intl_error_set( NULL, status, "locale_filter_matches : unable to canonicalize loc_range" , 0 ); RETURN_FALSE; @@ -1267,7 +1267,7 @@ PHP_FUNCTION(locale_filter_matches) /* canonicalize lang_tag */ can_lang_tag = get_icu_value_internal( lang_tag , LOC_CANONICALIZE_TAG , &result , 0); - if( result ==0) { + if( result <=0) { intl_error_set( NULL, status, "locale_filter_matches : unable to canonicalize lang_tag" , 0 ); RETURN_FALSE; diff --git a/ext/intl/tests/bug78804.phpt b/ext/intl/tests/bug78804.phpt new file mode 100644 index 00000000000..b0d58ec4309 --- /dev/null +++ b/ext/intl/tests/bug78804.phpt @@ -0,0 +1,13 @@ +--TEST-- +Bug #78804: Segmentation fault in Locale::filterMatches +--FILE-- + +--EXPECT-- +Not matches \ No newline at end of file