Skip to content

Commit

Permalink
KDReportsXmlParser.cpp - crash check found by coverity in release mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Allen Winter committed Sep 21, 2015
1 parent 974fc04 commit df3b826
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/KDReports/KDReportsXmlParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -527,12 +527,14 @@ bool KDReports::XmlParser::processNode( const QDomNode& node, KDReports::ReportB
return false;
}
Q_ASSERT( builder );
const QString type = element.attribute( QLatin1String( "type" ) );
KDReports::VariableType vt = KDReports::XmlHelper::stringToVariableType( type );
XmlElementHandlerV2* v2 = dynamic_cast<XmlElementHandlerV2 *>(m_xmlElementHandler);
if (v2 && !v2->variable(vt, element))
continue;
builder->addVariablePublic( vt );
if ( builder ) {
const QString type = element.attribute( QLatin1String( "type" ) );
KDReports::VariableType vt = KDReports::XmlHelper::stringToVariableType( type );
XmlElementHandlerV2* v2 = dynamic_cast<XmlElementHandlerV2 *>(m_xmlElementHandler);
if (v2 && !v2->variable(vt, element))
continue;
builder->addVariablePublic( vt );
}
} else if ( name == QLatin1String( "page-break" ) ) {
if ( m_xmlElementHandler && !m_xmlElementHandler->pageBreak( element ) )
continue;
Expand Down Expand Up @@ -621,7 +623,7 @@ void KDReports::XmlParser::parseTabs( KDReports::ReportBuilder *builder, const Q
tab.position = pos;
tabs.append( tab );
}
}
}
XmlElementHandlerV2* v2 = dynamic_cast<XmlElementHandlerV2 *>(m_xmlElementHandler);
if (!v2 || v2->tabs(tabs, tabsElement))
builder->setTabPositions( tabs );
Expand Down

0 comments on commit df3b826

Please sign in to comment.