summaryrefslogtreecommitdiff
path: root/ext/intl/locale/locale_methods.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/intl/locale/locale_methods.c')
-rw-r--r--ext/intl/locale/locale_methods.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/ext/intl/locale/locale_methods.c b/ext/intl/locale/locale_methods.c
index 862b9f5c87..39d80d524a 100644
--- a/ext/intl/locale/locale_methods.c
+++ b/ext/intl/locale/locale_methods.c
@@ -263,6 +263,9 @@ static char* get_icu_value_internal( const char* loc_name , char* tag_name, int*
int32_t buflen = 512;
UErrorCode status = U_ZERO_ERROR;
+ if (strlen(loc_name) > INTL_MAX_LOCALE_LEN) {
+ return NULL;
+ }
if( strcmp(tag_name, LOC_CANONICALIZE_TAG) != 0 ){
/* Handle grandfathered languages */
@@ -395,7 +398,7 @@ static void get_icu_value_src_php( char* tag_name, INTERNAL_FUNCTION_PARAMETERS)
if(loc_name_len == 0) {
loc_name = intl_locale_get_default(TSRMLS_C);
}
-
+
INTL_CHECK_LOCALE_LEN(strlen(loc_name));
/* Call ICU get */
@@ -702,6 +705,8 @@ PHP_FUNCTION( locale_get_keywords )
RETURN_FALSE;
}
+ INTL_CHECK_LOCALE_LEN(strlen(loc_name));
+
if(loc_name_len == 0) {
loc_name = intl_locale_get_default(TSRMLS_C);
}
@@ -1109,6 +1114,8 @@ PHP_FUNCTION(locale_parse)
RETURN_FALSE;
}
+ INTL_CHECK_LOCALE_LEN(strlen(loc_name));
+
if(loc_name_len == 0) {
loc_name = intl_locale_get_default(TSRMLS_C);
}