diff options
author | Ulf Hermann <ulf.hermann@theqtcompany.com> | 2016-04-01 11:36:04 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@theqtcompany.com> | 2016-04-04 08:19:20 +0000 |
commit | 85dce158094e95952d7870594b1d69969cdb2645 (patch) | |
tree | 4d7e204b948bdff2ecb333205e18ec6fc71b3163 /src | |
parent | 3fca319c7fbb011151f4c6d1d5ecf2ffef0589b0 (diff) |
Don't crash on invalid nested state machines
If an <invoke> tag doesn't contain a state machine, that's an error
and should be found when verifying. Also, don't try to verify the
nonexistent state machine.
Change-Id: Ib371f3f34c9ab5c20f9492b326d1fee87f7b76d2
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/scxml/qscxmlparser.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/scxml/qscxmlparser.cpp b/src/scxml/qscxmlparser.cpp index a0f247b..431077c 100644 --- a/src/scxml/qscxmlparser.cpp +++ b/src/scxml/qscxmlparser.cpp @@ -287,8 +287,12 @@ private: bool visit(DocumentModel::Invoke *node) Q_DECL_OVERRIDE { - ScxmlVerifier subVerifier(m_errorHandler); - m_hasErrors = !subVerifier.verify(node->content.data()); + if (node->content.isNull()) { + error(node->xmlLocation, QStringLiteral("no valid content found in <invoke> tag")); + } else { + ScxmlVerifier subVerifier(m_errorHandler); + m_hasErrors = !subVerifier.verify(node->content.data()); + } return false; } |