Skip to content

Fix: Prevent use-after-free in HTTPRequest completion callback#386

Open
seer-by-sentry[bot] wants to merge 1 commit intomainfrom
seer/fix/http-request-callback-uaf
Open

Fix: Prevent use-after-free in HTTPRequest completion callback#386
seer-by-sentry[bot] wants to merge 1 commit intomainfrom
seer/fix/http-request-callback-uaf

Conversation

@seer-by-sentry
Copy link

Fixes CLIENT-41R. The issue was that: HTTPRequest's std::function destructor accesses invalid captured lambda state, causing an access violation.

  • The m_completionCallback is now moved to a local variable before being invoked.
  • The m_completionCallback member is explicitly set to nullptr before the callback is executed.
  • This prevents a potential use-after-free issue if the HTTPRequest object is deleted (e.g., by HTTPManager::Tick) immediately after the callback returns, which could destroy the callback's captured state while it's still on the call stack.

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

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