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=15608>. 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=15608 IconvLCPTranscoder::transcode() is wrong at wcstombs() usage. Summary: IconvLCPTranscoder::transcode() is wrong at wcstombs() usage. Product: Xerces-C++ Version: 2.1.0 Platform: Other OS/Version: Other Status: NEW Severity: Normal Priority: Other Component: Miscellaneous AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] File: xerces-c-src2_1_0/src/xercesc/util/Transcoders/Iconv/IconvTransService.cpp Function: bool IconvLCPTranscoder::transcode( const XMLCh* const toTranscode , char* const toFill , const unsigned int maxBytes) The following logic is wrong, because wLent is the number of wide characters. unsigned int wLent = getWideCharLength(toTranscode); ::wcstombs(toFill, wideCharBuf, maxBytes); // Cap it off just in case toFill[wLent] = 0; It should be as follows (error handling is omitted), size_t mblen; mblen = ::wcstombs(toFill, wideCharBuf, maxBytes); toFill[mblen] = 0; --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]