Merge branch 'PHP-7.4'

* PHP-7.4:
  Fix bug #78804 - Segmentation fault in Locale::filterMatches
This commit is contained in:
Stanislav Malyshev 2019-11-11 23:08:52 -08:00
commit ad0a3f2886
2 changed files with 15 additions and 2 deletions

View file

@ -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;

View file

@ -0,0 +1,13 @@
--TEST--
Bug #78804: Segmentation fault in Locale::filterMatches
--FILE--
<?php
if (Locale::filterMatches('en-US', 'und', true)) {
echo 'Matches';
} else {
echo 'Not matches';
}
?>
--EXPECT--
Not matches