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

wrong string destruction in MemBufInputSource::~MemBufInputSource()

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.6.0
    • None
    • SAX/SAX2
    • None
    • Any

    Description

      MemBufInputSource::~MemBufInputSource()
      {
      if (fAdopted)
      delete [] (XMLByte*)fSrcBytes;
      }

      This seems terribly wrong. Constructor initializes fSrcBytes
      with its argument srcDocBytes and this never changes, so the
      original argument string is deleted here and not a copy of it.
      Actual creation and destruction of a copy if fAdopted is set
      is handled in BinMemInputStream which is instantiated in MemBufInputSource::makeStream(). Therefore the code quoted
      above should be removed from the destructor and it should do
      nothing.

      Regards
      Nikolay

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            nikolayo Nikolay Ognyanov
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment