Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-26824

XSD file causes QXmlSchema::load() to crash by eating memory in busy loop (showstopper)

    XMLWordPrintable

    Details

      Description

      The attached XSD file causes QXmlSchema::load() to hang in a busy loop consuming power of a complete CPU core and infinitely eating up memory and finally crashing.

      The XSD code is an extract of a much larger schema so it does not make much sense. Maybe there is an error in the XSD extract I can't see but in any case it may never cause the application to crash!

      <?xml version="1.0" encoding="utf-8"?>
      
      <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      
        <xsd:element name="items">
          <xsd:complexType>
            <xsd:choice minOccurs="1" maxOccurs="255">
              <xsd:element name="Item1" type ="first" minOccurs="0" maxOccurs="255"/>
              <xsd:element name="Item2" type ="second" minOccurs="0" maxOccurs="255"/>
            </xsd:choice>
          </xsd:complexType>
        </xsd:element>
        
        <xsd:complexType name="first">
        </xsd:complexType>
      
        <xsd:complexType name="second">
        </xsd:complexType>
      
      </xsd:schema>
      
      

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              silicomancer Bernhard Lindner
            • Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:

                Gerrit Reviews

                There are no open Gerrit changes