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

QDomDocument::importNode() crashes on null nodes

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • P2: Important
    • Some future release
    • 4.6.3
    • XML: DOM
    • None

    Description

      QDomDocument::importNode() is unable to import null nodes. Instead of simply returning a null node, it crashes with a segmentation fault. A typical code situation where this occurs is:

      QDomDocument doc1;
      doc1.setContent(QByteArray("<test/>"), true);
      QDomNode nullNode = doc1.elementsByTagName("doesnotexist").item(0);
      QDomDocument doc2;
      doc2.appendChild(doc2.importNode(nullNode, true));

      Minimal code snippet to reproduce the bug:

      QDomDocument doc;
      doc.importNode(QDomNode(), false);

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            vog Volker Grabsch
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes