-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
There appears to be an oversight in `async_result<>::initiate()`: it accepts all its arguments by forwarding references, it may capture a value on a stack of an asynchronous function, which would then go out of scope before the I/O really gets initiated. For example, co_await stream.async_handshake( ssl::stream_base::client, corral::asio_awaitable) (see the new `beast-https-client` test) triggers a stack-use-after-free, as it captures a reference to `async_handshake()`s copy of `stream_base::client`. Since asio appears to favor lightweight wrappers around any heavy objects (like `asio::buffer`), it looks like we can circumvent this by taking all arguments to initiation function by value.
- Loading branch information
1 parent
d125962
commit 77647fa
Showing
4 changed files
with
205 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters