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

Design flaw in QXmlPatterns: recursion leads to stack overflow

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P1: Critical P1: Critical
    • 5.4.0
    • 5.3.0, 5.3.1
    • XML: QtXmlPatterns
    • None
    • d1b17740ed4d9b1e3c3ad5898bb8259969dc77df

      Hi,
      I found a disturbing thing in QXmlPatterns - QPatternist::ItemMappingIterator::next() recursively calls itself, which leads to stack overflow if a XPath query is being done on a relatively large data set (in my example - about 15k xml elements). This results from a call in qnodesort.cpp:80:

      Item::List nodes(m_operand->evaluateSequence(context)->toList());

      The toList() method calls next() and all hell breaks loose.

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

            Unassigned Unassigned
            krojew Kamil Rojewski
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes