-
-
Save anonymous/9285ae2cb889a896cde2b893934d572d to your computer and use it in GitHub Desktop.
Patch for 73248.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
commit d3eb58332af433982f1e2ae9095fb087974a95f2 | |
Author: Stanislav Malyshev <stas@php.net> | |
Date: Tue Oct 4 21:28:40 2016 -0700 | |
Add more locale length checks, due to ICU bugs. | |
diff --git a/ext/intl/locale/locale_methods.c b/ext/intl/locale/locale_methods.c | |
index 443856f..862b9f5 100644 | |
--- a/ext/intl/locale/locale_methods.c | |
+++ b/ext/intl/locale/locale_methods.c | |
@@ -396,6 +396,8 @@ static void get_icu_value_src_php( char* tag_name, INTERNAL_FUNCTION_PARAMETERS) | |
loc_name = intl_locale_get_default(TSRMLS_C); | |
} | |
+ INTL_CHECK_LOCALE_LEN(strlen(loc_name)); | |
+ | |
/* Call ICU get */ | |
tag_value = get_icu_value_internal( loc_name , tag_name , &result ,0); | |
@@ -1159,6 +1161,7 @@ PHP_FUNCTION(locale_get_all_variants) | |
loc_name = intl_locale_get_default(TSRMLS_C); | |
} | |
+ INTL_CHECK_LOCALE_LEN(strlen(loc_name)); | |
array_init( return_value ); | |
@@ -1267,6 +1270,9 @@ PHP_FUNCTION(locale_filter_matches) | |
RETURN_TRUE; | |
} | |
+ INTL_CHECK_LOCALE_LEN(strlen(loc_range)); | |
+ INTL_CHECK_LOCALE_LEN(strlen(lang_tag)); | |
+ | |
if( boolCanonical ){ | |
/* canonicalize loc_range */ | |
can_loc_range=get_icu_value_internal( loc_range , LOC_CANONICALIZE_TAG , &result , 0); | |
@@ -1549,6 +1555,8 @@ PHP_FUNCTION(locale_lookup) | |
loc_range = intl_locale_get_default(TSRMLS_C); | |
} | |
+ INTL_CHECK_LOCALE_LEN(strlen(loc_range)); | |
+ | |
hash_arr = HASH_OF(arr); | |
if( !hash_arr || zend_hash_num_elements( hash_arr ) == 0 ) { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment