if( fromParseLocale==1 ){
/* Handle singletons */
if( strcmp(tag_name , LOC_LANG_TAG)==0 ){
- if( strlen(loc_name)>1 && (isIDPrefix(loc_name) ==1 ) ){
- return (char *)loc_name;
- if( strlen(loc_name)>1 && isIDPrefix(loc_name) ){
++ if( strlen(loc_name)>1 && (isIDPrefix(loc_name) == 1) ){
+ return estrdup(loc_name);
}
}
RETURN_FALSE;
}
+ if(loc_name_len > ULOC_FULLNAME_CAPACITY) {
+ /* See bug 67397: overlong locale names cause trouble in uloc_getDisplayName */
+ spprintf(&msg , 0, "locale_get_display_%s : name too long", tag_name );
+ intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, msg , 1 TSRMLS_CC );
+ efree(msg);
+ RETURN_FALSE;
+ }
+
if(loc_name_len == 0) {
- loc_name = INTL_G(default_locale);
+ loc_name = intl_locale_get_default(TSRMLS_C);
}
if( strcmp(tag_name, DISP_NAME) != 0 ){