commit | 9fcb876d3b7933f0b1fccfcf03b0f71a6f9b06af | [log] [tgz] |
---|---|---|
author | Dmitry-Me <wipedout@yandex.ru> | Thu Mar 05 17:53:34 2015 +0300 |
committer | Dmitry-Me <wipedout@yandex.ru> | Thu Mar 05 17:53:34 2015 +0300 |
tree | 572171cb29892df3580ee5ce317329acc599228e | |
parent | f12ece06fa6c9960af82548a0aea2c00e01eed76 [diff] [blame] |
Fix null pointer dereference planted in PR287 and reported in PR288
diff --git a/tinyxml2.cpp b/tinyxml2.cpp index 46f5f7f..ef00f13 100755 --- a/tinyxml2.cpp +++ b/tinyxml2.cpp
@@ -520,6 +520,8 @@ char* const start = p; p = XMLUtil::SkipWhiteSpace( p ); if( !*p ) { + *node = 0; + TIXMLASSERT( p ); return p; } @@ -848,6 +850,9 @@ XMLNode* node = 0; p = _document->Identify( p, &node ); + if ( node == 0 ) { + break; + } StrPair endTag; p = node->ParseDeep( p, &endTag );