Skip to content

fix(team): Prevent null dereference in TeamFactory::createTeam - #592

Open
sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/client-38x-team-factory-crash-sQpzMn
Open

fix(team): Prevent null dereference in TeamFactory::createTeam#592
sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/client-38x-team-factory-crash-sQpzMn

Conversation

@sentry

@sentry sentry Bot commented Sep 7, 2026

Copy link
Copy Markdown

This PR addresses CLIENT-38X by adding a null check in TeamFactory::createTeam before calling t->setActive().

Previously, createInactiveTeam(name) could return nullptr if the specified team prototype did not exist. TeamFactory::createTeam would then unconditionally attempt to call setActive() on this null pointer, leading to a fatal EXCEPTION_ACCESS_VIOLATION_READ crash.

The fix introduces a check: if createInactiveTeam returns nullptr, createTeam now safely returns nullptr as well. Callers of createTeam are already designed to handle a null return value, ensuring robust behavior.

Changes were applied to:

  • Generals/Code/GameEngine/Source/Common/RTS/Team.cpp
  • GeneralsMD/Code/GameEngine/Source/Common/RTS/Team.cpp

Fixes CLIENT-38X

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