forked from Mirrorlandia_minetest/irrlicht
CXMeshFileLoader: fix buffer overreads with text format
This commit is contained in:
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))
|
||||
|
Loading…
Reference in New Issue
Block a user