Skip to content
This repository has been archived by the owner on May 13, 2024. It is now read-only.

Commit

Permalink
CXMeshFileLoader: fix buffer overreads with text format
Browse files Browse the repository at this point in the history
  • Loading branch information
sfan5 committed Sep 28, 2023
1 parent 2f43dc7 commit 2a73252
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion source/Irrlicht/CXMeshFileLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 2a73252

Please sign in to comment.