You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by bu...@apache.org on 2002/12/22 15:46:42 UTC
DO NOT REPLY [Bug 15608] New: -
IconvLCPTranscoder::transcode() is wrong at wcstombs() usage.
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: xerces-c-dev@xml.apache.org
ReportedBy: inoue@ariel-networks.com
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: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org