summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2016-07-16 02:28:06 +0200
committerMarc Mutz <marc.mutz@kdab.com>2016-07-19 07:09:11 +0000
commit03f392f887132d5a2185627eef02db9ecf793396 (patch)
tree56147569244f50de84a8a6437f615c455d83b1fc /src
parentd91d3536eb82075aec25f3772c4209e15b7b3060 (diff)
downloadqtxmlpatterns-03f392f887132d5a2185627eef02db9ecf793396.tar.gz
Add some missing initialization
As reported by UBSan: xmlpatterns/expr/qorderby_p.h:78:15: runtime error: load of value 11181584, which is not a valid value for type 'Direction' xmlpatterns/expr/qorderby_p.h:78:15: runtime error: load of value 32766, which is not a valid value for type 'OrderingEmptySequence' xmlpatterns/schema/qxsdstatemachine_p.h:66:11: runtime error: load of value 2979516404, which is not a valid value for type 'NodeName' xmlpatterns/schema/qxsdschemaparser.cpp:340:67: runtime error: load of value 40, which is not a valid value for type 'bool' The init values are chosen to match what zero-initialization would have chosen. Change-Id: Iaf69720476cfe6c117dc2c91f39801a0be8bde54 Reviewed-by: Tobias Koenig <tobias.koenig@kdab.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/xmlpatterns/expr/qorderby_p.h2
-rw-r--r--src/xmlpatterns/schema/qxsdschemaparser.cpp1
-rw-r--r--src/xmlpatterns/schema/qxsdstatemachine_tpl_p.h8
3 files changed, 8 insertions, 3 deletions
diff --git a/src/xmlpatterns/expr/qorderby_p.h b/src/xmlpatterns/expr/qorderby_p.h
index addddf3..3e4a8f8 100644
--- a/src/xmlpatterns/expr/qorderby_p.h
+++ b/src/xmlpatterns/expr/qorderby_p.h
@@ -97,6 +97,8 @@ namespace QPatternist
* @short Default constructor, which is needed by QVector.
*/
inline OrderSpec()
+ : direction(Ascending),
+ orderingEmptySequence(StaticContext::Greatest)
{
}
diff --git a/src/xmlpatterns/schema/qxsdschemaparser.cpp b/src/xmlpatterns/schema/qxsdschemaparser.cpp
index 53b6152..2b2c880 100644
--- a/src/xmlpatterns/schema/qxsdschemaparser.cpp
+++ b/src/xmlpatterns/schema/qxsdschemaparser.cpp
@@ -247,6 +247,7 @@ XsdSchemaParser::XsdSchemaParser(const XsdSchemaContext::Ptr &context, const Xsd
, m_parserContext(parserContext)
, m_namePool(m_parserContext->namePool())
, m_namespaceSupport(m_namePool)
+ , m_defaultOpenContentAppliesToEmpty(false)
{
m_schema = m_parserContext->schema();
m_schemaResolver = m_parserContext->resolver();
diff --git a/src/xmlpatterns/schema/qxsdstatemachine_tpl_p.h b/src/xmlpatterns/schema/qxsdstatemachine_tpl_p.h
index d03bf0a..5caa26a 100644
--- a/src/xmlpatterns/schema/qxsdstatemachine_tpl_p.h
+++ b/src/xmlpatterns/schema/qxsdstatemachine_tpl_p.h
@@ -49,14 +49,16 @@
template <typename TransitionType>
XsdStateMachine<TransitionType>::XsdStateMachine()
- : m_counter(50)
+ : m_counter(50),
+ m_lastTransition()
{
}
template <typename TransitionType>
XsdStateMachine<TransitionType>::XsdStateMachine(const NamePool::Ptr &namePool)
- : m_namePool(namePool)
- , m_counter(50)
+ : m_namePool(namePool),
+ m_counter(50),
+ m_lastTransition()
{
}