mirror of https://github.com/AxioDL/tinyxml2.git
you have to check len before accsessing "p".
This commit is contained in:
parent
e1979a883b
commit
690ba07bda
|
@ -1702,6 +1702,11 @@ XMLError XMLDocument::Parse( const char* p, size_t len )
|
|||
const char* start = p;
|
||||
Clear();
|
||||
|
||||
if ( len == 0 ) {
|
||||
SetError( XML_ERROR_EMPTY_DOCUMENT, 0, 0 );
|
||||
return _errorID;
|
||||
}
|
||||
|
||||
if ( !p || !*p ) {
|
||||
SetError( XML_ERROR_EMPTY_DOCUMENT, 0, 0 );
|
||||
return _errorID;
|
||||
|
|
Loading…
Reference in New Issue