Fix heap-buffer-overflow 71/256571/2
authorHeeyong Song <heeyong.song@samsung.com>
Wed, 7 Apr 2021 08:41:25 +0000 (17:41 +0900)
committerHeeyong Song <heeyong.song@samsung.com>
Mon, 12 Apr 2021 08:16:29 +0000 (08:16 +0000)
Change-Id: I2deb2c089f8cd81155d53467d31e47fd3051c244

examples/reflection-demo/gltf-scene.cpp

index d752149..9b5a67f 100644 (file)
@@ -163,6 +163,8 @@ void glTF::LoadFromFile(const std::string& filename)
   mBuffer    = LoadFile(binFile);
   jsonBuffer = LoadFile(jsonFile);
 
+  jsonBuffer.push_back('\0'); // It should be null terminated.
+
   // Log errors
   if(mBuffer.empty())
   {