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 "Martin Raiber (JIRA)" <xe...@xml.apache.org> on 2013/07/29 16:43:51 UTC

[jira] [Created] (XERCESC-2020) Of-by-one error in TranscodeFromStr (with ICU)

Martin Raiber created XERCESC-2020:
--------------------------------------

             Summary: Of-by-one error in TranscodeFromStr (with ICU)
                 Key: XERCESC-2020
                 URL: https://issues.apache.org/jira/browse/XERCESC-2020
             Project: Xerces-C++
          Issue Type: Bug
          Components: Utilities
    Affects Versions: 3.1.1
         Environment: ICU, Visual C++ 2012
            Reporter: Martin Raiber


The char-Array charSizes in TranscodeFromStr::transcode is initialized with length csSize.
ICUTranscoder::transcodeFrom is called with maxChars=csSize+1.
For a fixed length encoding charSizes is set via memset(charSizes, fillSize, maxChars); writing one character too much.

To reproduce:
xercesc::TranscodeFromStr transcoder(reinterpret_cast<const XMLByte*>("foo"), 3, "ISO-8859-15");

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org