ICU-4576 Fix buffer overrun in findWindowsZoneID: wasn't leaving room for trailing null when allocating buffer from heap.

X-SVN-Rev: 19027
This commit is contained in:
Eric Mader 2006-01-26 21:51:27 +00:00
parent 913207b34a
commit 3d0b127c12

View file

@ -282,7 +282,7 @@ static const char *findWindowsZoneID(const UChar *icuid, int32_t length)
* trailing null.
*/
if (length >= ICUID_STACK_BUFFER_SIZE) {
buffer = NEW_ARRAY(char, length);
buffer = NEW_ARRAY(char, length + 1);
}
u_UCharsToChars(icuid, buffer, length);