You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Prior to commit e93f823, the above scenario called
`socket->accept().get()` and passed the returned value to RunDebugServer
causing the lifetime of the temporary returned by `socket->accept()` to
be extended until the end of the RunDebugServer call. Commit e93f823
instead stored the above `.get()`'s returned (raw) pointer in a stack
local, allowing `socket->accept()`'s return value to go out of scope
before the call to `RunDebugServer`, and since it's a std::unique_ptr,
the underlying `Socket` to be freed, making the raw pointer no longer
valid.
This commit ensures the `accept()`ed Socket is held in a
`std::unique_ptr` of its own and outlives the call to `RunDebugServer`.
0 commit comments