mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-14 07:47:13 +00:00
fix(zone): lengths and counts in zone files are checked against what is left of the file
A string length, the path chunk's length and an object's render technique count are compared with the bytes left before memory is set aside for them. The terrain reader is built into dCommon, so every server that reads zone files has it. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
@@ -247,6 +247,8 @@ void LevelFile::ReadSceneObjectDataChunk(std::istream& file) {
|
||||
BinaryIO::BinaryRead(file, techniqueCount);
|
||||
if (techniqueCount != 0) {
|
||||
obj.renderTechniquesName = ReadName64(file);
|
||||
// A technique is its 64 byte name, a count, a flag and 16 values
|
||||
BinaryIO::RequireRemaining(file, static_cast<uint64_t>(techniqueCount) * (64 + 4 + 1 + 16 * 4));
|
||||
obj.renderTechniques.resize(techniqueCount);
|
||||
for (auto& technique : obj.renderTechniques) {
|
||||
technique.name = ReadName64(file);
|
||||
|
||||
Reference in New Issue
Block a user