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

QXmlStreamReader causes access violation if parsing xml larger than 8kB

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P1: Critical
    • None
    • 5.11.1
    • None
    • Windows 10 Pro, Version 1803, OS Build 17134.165,
      Qt 5.11.1,Kit MSVSC2015 32bit, QtCreator 4.6.2.
    • Windows

    Description

      When parsing XML of size 8226 bytes QXmlStreamReader causes access violation.

      I have simple XML with one lagre mutli line comment.Comment itself has 8019 characters, including whitespace characters, whereas entire XML file has 8266 characters.

      I have checked that XML is valid in Notepad++ with XML Tools plugin and also on xmlvalidation.xml.

      When I execute  example I have access violation in QIODevice.cpp.

      Now, if I remove last "o" character from comment in XML(or any other character from comment, or e.g. "6" from text of element6, or as a matter of fact any character from XML while keeping XML valid), example is executed successfully. In actual solution XML have a lot of comments, resulting file to be larger that 8KB. For now, as a workaround, I remove comments to avoid access violation. But those comments describes each config parameter and I would rather keep them.

      It is not clear to me how does comment/file length causes access violation.

      main.cpp config.xml and XmlParser.pro are attached.

      XmlParser.7z

      Attachments

        1. CallStack.png
          CallStack.png
          117 kB
        2. XmlParser.7z
          1 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            allan.jensen Allan Sandfeld Jensen
            rocky.j.rambo Rocky Rambo
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes