Uploaded image for project: 'XMLBeans'
  1. XMLBeans
  2. XMLBEANS-335

org.apache.xmlbeans.XmlException: error: Unexpected end of file in CDATA section when saving large documents

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • Version 2.2.1, Version 2.3
    • Version 2.3.1
    • None
    • None

    Description

      There is a bug in the class org.apache.xmlbeans.impl.store.Saver and its inner class TextSaver. The error occurs rarely and is hard to reproduce but in certain circumstances it gives an org.apache.xmlbeans.XmlException: error: Unexpected end of file in CDATA section when saving an xml document. The problem is in the private method resize that calculates the number of free bytes wrong when resize is done on an empty buffer. The number of free bytes is set to "_free += newBuf.length" but since the buffer was empty _free will take the value of previous buffers length + new buffers length. It should instead be _free = newBuf.length.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              gille Johan Gilliusson
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: