From: Bob Verbrugge <email@example.com>
To: Ibm Classes For Unicode/Cupertino/IBM@IBMUS
Subject: Some ICU remarks
I noticed following when scanning the some code in common in the
1. Use of malloc instead of icu_malloc in umutex.c
2. Use of realloc instead of icu_realloc in uchar.c and uhash.c
3. Use of free instead of icu_free in filestrm.c
4. Use of memcpy instead of icu_memcpy in putil.c and utypes.h
5. Use of memset instead of icu_memset in putil.c
Seems to me it is more appropriate to use the icu_ versions of
In the converter interface char * and char ** is used
(ucnv_fromUChars, ucnv_toUChars etc) for the legacy character
set streams. It seems better to me to use unsigned char * /
unsigned char ** instead, or probably even better to hide the
native C data types and use uint8_t * / uint8_t ** or a new
type definition for legacy character set streams.
Also i noticed that the substitution character (<subchar> in the
ucm files) is not used for MBCS character sets. Is this done
The library contains some great stuff by the way!
From: Marvin Mah <firstname.lastname@example.org>
Date: Thu, 19 Aug 1999 13:23:36 -0400
Subject: NULL pointer access
Content-Type: text/plain; charset="us-ascii"
I was debugging an exception and traced it down to the icu classes.
It looks like when ever a call is made to UnicodeString::remove() it
eventually ends up calling UnicodeString::doReplace(UTextOffset, int32_t,
const UChar *, UTextOffset, int32_t) passing in 0 value for const UChar
This leads to a NULL pointer access in :
us_arrayCopy(srcChars, srcStart, getArrayStart(), start, srcLength);
(us_arrayCopy maps to icu_memmove() which maps to memmove()
Is this a known problem or do I have wrong files?