Skip to content

Conversation

@seer-by-sentry
Copy link

Fixes CLIENT-2A2. The issue was that: Truncated executable path during SetCurrentDirectory leads to __security_init_cookie calling GetFullPathNameW with invalid data, causing wcsnlen to read-access violate.

  • Improved GetModuleFileName usage in WinMain to check for truncation and ensure valid paths before setting the current directory.
  • Added buffer overflow checks when constructing user data directory paths in GlobalData.cpp (Generals).
  • Ensured SHGetSpecialFolderPath results are valid and not truncated before use in GlobalData.cpp (GeneralsMD).
  • Corrected GetModuleFileNameW truncation check in MiniDumper to use '>=' instead of '==' for more accurate buffer overflow detection.

This fix was generated by Seer in Sentry, triggered automatically. 👁️ Run ID: 8439454

Not quite right? Click here to continue debugging with Seer.

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