diff --git a/src/osgPlugins/md2/ReaderWriterMD2.cpp b/src/osgPlugins/md2/ReaderWriterMD2.cpp index dd9d6bf73..c10399520 100644 --- a/src/osgPlugins/md2/ReaderWriterMD2.cpp +++ b/src/osgPlugins/md2/ReaderWriterMD2.cpp @@ -165,7 +165,8 @@ load_md2 (const char *filename, const osgDB::ReaderWriter::Options* options) return NULL; } - mapbase = malloc (st.st_size); + mapbase = malloc (st.st_size+1); + memset(mapbase, 0, st.st_size+1); if (!mapbase) { close (file_fd);