-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IPC] Don't unwrap invalid SendSyncResult replies
https://bugs.webkit.org/show_bug.cgi?id=259301 rdar://111895837 Reviewed by Dean Jackson. We have a number of crash reports from an assert firing in std::optional when unwrapping the result of a synchronous IPC call. This assert hints that we have received a result where `succeeded()` returns true, yet we don't have a reply payload in replyArguments. This is a violation of the prerequisites for `ConnectionSendSyncReply`. This issue has been causes by improper handling of `decoder` failure and has been fixed piecemeal, for example in https://bugs.webkit.org/show_bug.cgi?id=259006. This change extends the succeeded check to include checking for non-none replyArguments to avoid asserting when using `if (sendResult.succeeded()) { ... = sendResult.reply(); }` pattern. As an extra level of protection, the new ConnecttionSendSyncResult will set error to Error::Unspecified if passed replyArguments that are none. * Source/WebKit/Platform/IPC/Connection.h: (IPC::ConnectionSendSyncResult::ConnectionSendSyncResult): (IPC::ConnectionSendSyncResult::succeeded const): (IPC::Connection::sendSync): * Source/WebKit/Platform/IPC/MessageSenderInlines.h: (IPC::MessageSender::sendSync): * Source/WebKit/Platform/IPC/StreamClientConnection.h: (IPC::StreamClientConnection::sendSync): (IPC::StreamClientConnection::trySendSyncStream): * Source/WebKit/UIProcess/AuxiliaryProcessProxy.h: (WebKit::AuxiliaryProcessProxy::sendSync): Canonical link: https://commits.webkit.org/266147@main
- Loading branch information
Showing
4 changed files
with
31 additions
and
21 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