ICU-7039 Fix pointer integer comparison.

X-SVN-Rev: 26458
This commit is contained in:
Michael Ow 2009-07-30 16:47:30 +00:00
parent 803387f796
commit 4ca1eed83e

View file

@ -4047,7 +4047,8 @@ UnicodeString::extract(int32_t start,
{
// This dstSize value will be checked explicitly
return extract(start, _length, dst, dst!=0 ? ((dst >= ((size_t)-1) - UINT32_MAX) ? (((char*)UINT32_MAX) - dst) : UINT32_MAX) : 0, codepage);
// Ticket #7039: Clip length to the maximum valid length to the end of addressable memory given the starting address
return extract(start, _length, dst, dst!=0 ? ((dst >= (char*)((size_t)-1) - UINT32_MAX) ? (((char*)UINT32_MAX) - dst) : UINT32_MAX) : 0, codepage);
}
#endif