commit | 96b110d25e3bc4982b8c5becedabd5cde46ed8d8 | [log] [tgz] |
---|---|---|
author | Dmitry-Me <wipedout@yandex.ru> | Tue Feb 09 15:12:40 2016 +0300 |
committer | Dmitry-Me <wipedout@yandex.ru> | Tue Feb 09 15:12:40 2016 +0300 |
tree | e537ff03605b7fe3629e5d05d24955d674fa85e2 | |
parent | 9ff66541748533f87df0fd15015fa9341d18f0f0 [diff] [blame] |
Assert to ensure ftell() behaves as expected by later code
diff --git a/tinyxml2.cpp b/tinyxml2.cpp index c4ea7cd..df49d0d 100755 --- a/tinyxml2.cpp +++ b/tinyxml2.cpp
@@ -1954,6 +1954,7 @@ SetError( XML_ERROR_FILE_READ_ERROR, 0, 0 ); return _errorID; } + TIXMLASSERT( filelength >= 0 ); if ( !LongFitsIntoSizeTMinusOne<>::Fits( filelength ) ) { // Cannot handle files which won't fit in buffer together with null terminator