From 03f392f887132d5a2185627eef02db9ecf793396 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Sat, 16 Jul 2016 02:28:06 +0200 Subject: 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 Reviewed-by: Frederik Gladhorn --- src/xmlpatterns/expr/qorderby_p.h | 2 ++ src/xmlpatterns/schema/qxsdschemaparser.cpp | 1 + src/xmlpatterns/schema/qxsdstatemachine_tpl_p.h | 8 +++++--- 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 XsdStateMachine::XsdStateMachine() - : m_counter(50) + : m_counter(50), + m_lastTransition() { } template XsdStateMachine::XsdStateMachine(const NamePool::Ptr &namePool) - : m_namePool(namePool) - , m_counter(50) + : m_namePool(namePool), + m_counter(50), + m_lastTransition() { } -- cgit v1.2.1