DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21990>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21990

ICULCPTranscoder::transcode memory leak





------- Additional Comments From [EMAIL PROTECTED]  2003-08-22 21:16 -------
Wouldn't it be simpler just to exclude the extra character from the initial 
call, so either case results in a buffer overflow?  For example:

    UErrorCode err = U_ZERO_ERROR;
    int32_t targetCap;
    {
        XMLMutexLock lockConverter(&fMutex);

        targetCap = ucnv_fromUChars
        (
            fConverter
            , retBuf
            // , targetLen + 1
            , targetLen
            , actualSrc
            , -1
            , &err
        );
    }

That way, there's no need to check for the extra return value.

The other thing that mystifies me is why the Xerces code is doing null-
termination, when the ICU function is specifically designed to terminate, if 
there's sufficient capacity.

It seems to me the code should really be using ucnv_fromUnicode().

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to