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
1 changed files with 2 additions and 1 deletions

View File

@ -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))