Skip to content

fix: Prevent crash when unknown module referenced in INI - #586

Open
sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/client-317-null-module-data
Open

fix: Prevent crash when unknown module referenced in INI#586
sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/client-317-null-module-data

Conversation

@sentry

@sentry sentry Bot commented Sep 1, 2026

Copy link
Copy Markdown

Addresses CLIENT-317: "ThingTemplate::parseModuleName".

This change prevents a crash that occurred when an INI file referenced an unknown or unregistered module name. The TheModuleFactory->newModuleDataFromINI() function would return a nullptr for such cases, which was then immediately dereferenced by data->isAiModuleData() without a null check, leading to an access violation.

A null check has been added for the data pointer after the call to newModuleDataFromINI(). If data is null, a DEBUG_CRASH is triggered, and INI_INVALID_DATA is thrown, providing a graceful error handling mechanism instead of a hard crash.

This fix has been applied in:

  • Generals/Code/GameEngine/Source/Common/Thing/ThingTemplate.cpp
  • GeneralsMD/Code/GameEngine/Source/Common/Thing/ThingTemplate.cpp

Fixes CLIENT-317

This PR was automatically generated by Sentry. You can adjust this setting at any time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants