mirror of
https://github.com/minetest/irrlicht.git
synced 2024-11-05 01:40:44 +01:00
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