1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Merge branch 'PHP-7.2' into PHP-7.3

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

View File

@@ -1285,7 +1285,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;
@@ -1293,7 +1293,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