*/
static zend_string* get_icu_value_internal( const char* loc_name , char* tag_name, int* result , int fromParseLocale)
{
- zend_string* tag_value = NULL;
- int32_t tag_value_len = 512;
+ zend_string* tag_value = NULL;
+ int32_t tag_value_len = 512;
- int singletonPos = 0;
- char* mod_loc_name = NULL;
- int grOffset = 0;
+ zend_off_t singletonPos = 0;
+ char* mod_loc_name = NULL;
+ zend_off_t grOffset = 0;
- int32_t buflen = 512;
- UErrorCode status = U_ZERO_ERROR;
+ 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 */