Skip to content

Commit

Permalink
Merge pull request #5051 from ab9rf/sizecheck
Browse files Browse the repository at this point in the history
sizecheck: add safety check
  • Loading branch information
myk002 authored Nov 28, 2024
2 parents 9c37565 + 4532d5c commit e1ffa61
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions library/Core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1663,6 +1663,9 @@ bool Core::InitMainThread() {

for (auto& gte : *df::global::global_table)
{
// this will exit the loop when the terminator is hit, in the event the global table size in structures is incorrect
if (gte.address == nullptr || gte.name == nullptr)
break;
std::string name{ gte.name };
if (sizechecks.contains(name) && gte.size != sizechecks.at(name))
{
Expand Down

0 comments on commit e1ffa61

Please sign in to comment.