diff --git a/CMakeLists.txt b/CMakeLists.txt index f83b91f..83a6ab7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,7 +10,7 @@ include(GNUInstallDirs) ################################ # set lib version here -set(GENERIC_LIB_VERSION "1.0.2") +set(GENERIC_LIB_VERSION "1.0.3") set(GENERIC_LIB_SOVERSION "1") diff --git a/dox b/dox index d9d6e40..31ffa76 100755 --- a/dox +++ b/dox @@ -32,7 +32,7 @@ PROJECT_NAME = "TinyXML-2" # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = 1.0.2 +PROJECT_NUMBER = 1.0.3 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer diff --git a/tinyxml2.cpp b/tinyxml2.cpp index 1fbf8aa..de1f173 100644 --- a/tinyxml2.cpp +++ b/tinyxml2.cpp @@ -1394,7 +1394,12 @@ int XMLDocument::LoadFile( FILE* fp ) } charBuffer = new char[size+1]; - fread( charBuffer, size, 1, fp ); + size_t read = fread( charBuffer, 1, size, fp ); + if ( read != size ) { + SetError( XML_ERROR_FILE_READ_ERROR, 0, 0 ); + return errorID; + } + charBuffer[size] = 0; const char* p = charBuffer; diff --git a/tinyxml2.h b/tinyxml2.h index e43b5be..e90d60f 100644 --- a/tinyxml2.h +++ b/tinyxml2.h @@ -85,7 +85,7 @@ distribution. static const int TIXML2_MAJOR_VERSION = 1; static const int TIXML2_MINOR_VERSION = 0; -static const int TIXML2_PATCH_VERSION = 2; +static const int TIXML2_PATCH_VERSION = 3; namespace tinyxml2 { @@ -727,6 +727,7 @@ enum { XML_ERROR_FILE_NOT_FOUND, XML_ERROR_FILE_COULD_NOT_BE_OPENED, + XML_ERROR_FILE_READ_ERROR, XML_ERROR_ELEMENT_MISMATCH, XML_ERROR_PARSING_ELEMENT, XML_ERROR_PARSING_ATTRIBUTE,