From 061e52b89fb33d34ee1b6ad9648875cbb8338c79 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Tue, 31 Oct 2017 17:02:31 +0000 Subject: [PATCH] Fixed Coverity Scan reported issue --- src/osgPlugins/md2/ReaderWriterMD2.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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);