mirror of https://github.com/AxioDL/tinyxml2.git
Fix null pointer dereference planted in PR287 and reported in PR288
This commit is contained in:
parent
f12ece06fa
commit
9fcb876d3b
|
@ -520,6 +520,8 @@ char* XMLDocument::Identify( char* p, XMLNode** node )
|
||||||
char* const start = p;
|
char* const start = p;
|
||||||
p = XMLUtil::SkipWhiteSpace( p );
|
p = XMLUtil::SkipWhiteSpace( p );
|
||||||
if( !*p ) {
|
if( !*p ) {
|
||||||
|
*node = 0;
|
||||||
|
TIXMLASSERT( p );
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -848,6 +850,9 @@ char* XMLNode::ParseDeep( char* p, StrPair* parentEnd )
|
||||||
XMLNode* node = 0;
|
XMLNode* node = 0;
|
||||||
|
|
||||||
p = _document->Identify( p, &node );
|
p = _document->Identify( p, &node );
|
||||||
|
if ( node == 0 ) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
StrPair endTag;
|
StrPair endTag;
|
||||||
p = node->ParseDeep( p, &endTag );
|
p = node->ParseDeep( p, &endTag );
|
||||||
|
|
Loading…
Reference in New Issue