Fix null pointer dereference planted in PR287 and reported in PR288

This commit is contained in:
Dmitry-Me 2015-03-05 17:53:34 +03:00
parent f12ece06fa
commit 9fcb876d3b
1 changed files with 5 additions and 0 deletions

View File

@ -520,6 +520,8 @@ char* XMLDocument::Identify( char* p, XMLNode** node )
char* const start = p;
p = XMLUtil::SkipWhiteSpace( p );
if( !*p ) {
*node = 0;
TIXMLASSERT( p );
return p;
}
@ -848,6 +850,9 @@ char* XMLNode::ParseDeep( char* p, StrPair* parentEnd )
XMLNode* node = 0;
p = _document->Identify( p, &node );
if ( node == 0 ) {
break;
}
StrPair endTag;
p = node->ParseDeep( p, &endTag );