From 96b110d25e3bc4982b8c5becedabd5cde46ed8d8 Mon Sep 17 00:00:00 2001 From: Dmitry-Me Date: Tue, 9 Feb 2016 15:12:40 +0300 Subject: [PATCH] Assert to ensure ftell() behaves as expected by later code --- tinyxml2.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/tinyxml2.cpp b/tinyxml2.cpp index c4ea7cd..df49d0d 100755 --- a/tinyxml2.cpp +++ b/tinyxml2.cpp @@ -1954,6 +1954,7 @@ XMLError XMLDocument::LoadFile( FILE* fp ) 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