diff options
author | Frank Osterfeld <frank@kdab.net> | 2010-08-05 11:42:58 (GMT) |
---|---|---|
committer | Olivier Goffart <olivier.goffart@nokia.com> | 2010-08-05 11:44:17 (GMT) |
commit | 637d207e397c13c09a8dcbd718ee85bce2548e90 (patch) | |
tree | b2f1622b6099ff6711e159e3393c2357563cfa6d /tests | |
parent | e5071275f719ec36ff5e14b1e92258f270ef22b6 (diff) | |
download | Qt-637d207e397c13c09a8dcbd718ee85bce2548e90.zip Qt-637d207e397c13c09a8dcbd718ee85bce2548e90.tar.gz Qt-637d207e397c13c09a8dcbd718ee85bce2548e90.tar.bz2 |
QDom: Do not crash on "<a:>text</a:>"
"a:" is not a valid tagname. The function creating the element node
notices that and returns 0, but the parser ignores it and continues,
and then crashes later when processing the "text". This patch aborts
the parsing immediately when creating the element node failed and
fixes the crash.
Merge-request: 2431
Reviewed-by: Olivier Goffart <olivier.goffart@nokia.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qdom/tst_qdom.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/auto/qdom/tst_qdom.cpp b/tests/auto/qdom/tst_qdom.cpp index 0f6cdaa..8bf7620 100644 --- a/tests/auto/qdom/tst_qdom.cpp +++ b/tests/auto/qdom/tst_qdom.cpp @@ -1776,6 +1776,7 @@ void tst_QDom::crashInSetContent() const QDomImplementation::setInvalidDataPolicy(QDomImplementation::ReturnNullNode); QDomDocument docImport; + QCOMPARE(docImport.setContent(QLatin1String("<a:>text</a:>"), true), false); QVERIFY(docImport.setContent(QLatin1String("<?xml version=\"1.0\"?><e/>"))); } |