Skip to content

HTTPRequest: Prevent use-after-free in HTTPRequest callbacks during shutdown - #99

Open
seer-by-sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/http-callback-shutdown
Open

HTTPRequest: Prevent use-after-free in HTTPRequest callbacks during shutdown#99
seer-by-sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/http-callback-shutdown

Conversation

@seer-by-sentry

Copy link
Copy Markdown

Fixes CLIENT-NZ. The issue was that: HTTPRequest is deleted immediately after invoking its completion callback, causing a use-after-free crash in the std::function destructor.

  • Added a boolean parameter bInvokeCallback to Threaded_SetComplete to control callback invocation.
  • Modified HTTPRequest::Threaded_SetComplete to clear the completion and progress callbacks when bInvokeCallback is false to prevent use-after-free issues during shutdown.
  • Modified HTTPManager::MultiPerform to call Threaded_SetComplete with bInvokeCallback = false during shutdown.
  • Modified HTTPRequest::InvokeDelayAction and HTTPManager::MultiPerform to call Threaded_SetComplete with bInvokeCallback = true during normal operation (Tick).

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

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