diff options
| -rw-r--r-- | NEWS | 7 | ||||
| -rw-r--r-- | ext/intl/locale/locale_methods.c | 4 | ||||
| -rw-r--r-- | ext/intl/tests/bug78804.phpt | 13 |
3 files changed, 20 insertions, 4 deletions
@@ -2,6 +2,9 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? ??? 2019, PHP 7.2.26 +- Intl: + . Fixed bug #78804 (Segmentation fault in Locale::filterMatches). (Stas) + - Standard: . Fixed bug #78759 (array_search in $GLOBALS). (Nikita) @@ -27,7 +30,7 @@ PHP NEWS cmb). - OpCache: - . Fixed bug #78654 (Incorrectly computed opcache checksum on files with + . Fixed bug #78654 (Incorrectly computed opcache checksum on files with non-ascii characters). (mhagstrand) . Fixed bug #78747 (OpCache corrupts custom extension result). (Nikita) @@ -36,7 +39,7 @@ PHP NEWS connections). (Nikita) - Reflection: - . Fixed bug #78697 (ReflectionClass::ImplementsInterface - inaccurate error + . Fixed bug #78697 (ReflectionClass::ImplementsInterface - inaccurate error message with traits). (villfa) - Sockets: diff --git a/ext/intl/locale/locale_methods.c b/ext/intl/locale/locale_methods.c index 768ae84d2c..3379916822 100644 --- a/ext/intl/locale/locale_methods.c +++ b/ext/intl/locale/locale_methods.c @@ -1292,7 +1292,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; @@ -1300,7 +1300,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 0000000000..b0d58ec430 --- /dev/null +++ b/ext/intl/tests/bug78804.phpt @@ -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
\ No newline at end of file |
