ICU-6515 fix genbrk memory overrun (contributed patch)

X-SVN-Rev: 24602
This commit is contained in:
Steven R. Loomis 2008-09-18 23:17:37 +00:00
parent e87b382542
commit da3b9a1d29

View File

@ -1705,8 +1705,11 @@ int_getDefaultCodepage()
#elif defined(OS390)
static char codepage[64];
sprintf(codepage,"%63s" UCNV_SWAP_LFNL_OPTION_STRING, nl_langinfo(CODESET));
strncpy(codepage, nl_langinfo(CODESET),63-strlen(UCNV_SWAP_LFNL_OPTION_STRING));
strcat(codepage,UCNV_SWAP_LFNL_OPTION_STRING);
codepage[63] = 0; /* NULL terminate */
return codepage;
#elif defined(XP_MAC)