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