Commit 272fa31
committed
Fix use-after-free race condition in winhttp.
Essentially, the request_context could call ->finish() (and free itself) before the final WinHttp callback completed.
The fix, without changing lifetime semantics, is to use a heap-allocated weak_ptr as the context. This weak_ptr will be freed by the callback function when called with WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING.1 parent 6c8f948 commit 272fa31
File tree
2 files changed
+311
-269
lines changed- Release/src
- http/client
- pch
2 files changed
+311
-269
lines changed
0 commit comments