Uploaded image for project: 'Xerces-C++'
  1. Xerces-C++
  2. XERCESC-2020

Off-by-one error in TranscodeFromStr (with ICU)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.1.1
    • 3.1.2, 3.2.0
    • Utilities
    • None
    • ICU, Visual C++ 2012

    Description

      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");

      Attachments

        Activity

          People

            amassari Alberto Massari
            martin01 Martin Raiber
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: