CXMeshFileLoader: fix buffer overreads with text format

This commit is contained in:
sfan5 2023-09-18 21:39:56 +02:00
parent 103ab16679
commit 6f4f7c4d75

@ -396,7 +396,8 @@ bool CXMeshFileLoader::readFileIntoMemory(io::IReadFile* file)
return false;
}
Buffer = new c8[size];
Buffer = new c8[size+1];
Buffer[size] = 0x0; // null-terminate
//! read all into memory
if (file->read(Buffer, size) != static_cast<size_t>(size))