Uploaded image for project: 'Cocoon'
  1. Cocoon
  2. COCOON-2158

XMLByteStreamCompiler hard-coded limits of 0xffff Strings prevents large XML documents from being handled in Cocoon

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 2.1.6, 2.1.7, 2.1.8, 2.1.9, 2.1.10, 2.1.11, 2.1.12
    • 2.1.12, 2.2
    • * Cocoon Core
    • None
    • Urgent
    • Patch available
    • Cocoon Core
    • Cocoon Core

    Description

      The hard-coded limits in XMLByteStreamCompiler prevent Cocoon from handling large XML documents.

      See the methods writeString and writeAttributes for the hard coded arbitrary maximums:

      if (i > 0xFFFF) throw new SAXException("Index too large");

      if (attributes > 0xFFFF) throw new SAXException("Too many attributes");

      Additionally, the hand-coded bit manipulation is pretty difficult to change in order to work around this.

      I am attaching a patch for 2.1.11 that updates the existing JUnit test case to reproduce the problem, as well as a fix to the problem that uses the DataInputStream and DataOutputStream for the low-level bit manipulation.

      Attachments

        1. cocoon-xmlbytestream.patch
          40 kB
          Eric Meyer
        2. cocoon-xmlbytestream-bigstrings.patch
          44 kB
          Eric Meyer

        Activity

          People

            antonio Antonio Gallardo Rivera
            eric.meyer Eric Meyer
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: