Skip to content

Fix potential issues when determining application working directory on startup - #210

Open
seer-by-sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/winmain-cwd-robustness
Open

Fix potential issues when determining application working directory on startup#210
seer-by-sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/winmain-cwd-robustness

Conversation

@seer-by-sentry

@seer-by-sentry seer-by-sentry Bot commented Jan 4, 2026

Copy link
Copy Markdown

Fixes CLIENT-1HJ. The issue was that: Unvalidated strrchr result during working directory setup causes NULL pointer dereference, corrupting stack before GetFullPathNameW call.

  • Improved robustness when using GetModuleFileName to determine the application's directory path in various WinMain implementations.
  • The path buffer is now explicitly initialized to null.
  • The return value of GetModuleFileName is checked to ensure the call succeeded and the path was not truncated.
  • SetCurrentDirectory is only called if the module file name retrieval and path parsing were successful.

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

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