ICU-463 Put fix for pointer overflow back into code.

X-SVN-Rev: 2360
This commit is contained in:
George Rhoten 2000-08-28 19:18:02 +00:00
parent 9e89664fa6
commit 16d67c3ebb
2 changed files with 4 additions and 4 deletions

View File

@ -2571,7 +2571,8 @@ UnicodeString::extract(UTextOffset start,
int32_t length,
char *dst,
const char *codepage) const
{return extract(start, length, dst, INT32_MAX, codepage);}
// This dstSize value should prevent pointer overflow
{return extract(start, length, dst, 0x0FFFFFFF, codepage);}
inline void
UnicodeString::extractBetween(UTextOffset start,

View File

@ -1251,10 +1251,9 @@ UnicodeString::extract(UTextOffset start,
/* Pin the limit to U_MAX_PTR. NULL check is for AS/400. */
/* [grhoten] What sort of silly assumption is this? */
/* if((myTargetLimit < myTarget) || (myTargetLimit == NULL)) {
if((myTargetLimit < myTarget) || (myTargetLimit == NULL)) {
myTargetLimit = (char*)U_MAX_PTR;
}*/
}
if (myTarget != NULL) {
ucnv_fromUnicode(converter, &myTarget, myTargetLimit,