Commit f9283675 authored by Ayu Ishii's avatar Ayu Ishii Committed by Commit Bot

SMS Receiver: Fix crash in sms due to |frame| == nullptr.

This change add a check to ensure frame is available, and to return
and error if not before proceeding with the call.

Bug: 1027394
Change-Id: Ib839321b7a9eef193b4285523ac60344d4a3a049
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1947192
Commit-Queue: Victor Costan <pwnall@chromium.org>
Reviewed-by: default avatarVictor Costan <pwnall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#721763}
parent d5e90ceb
......@@ -36,6 +36,12 @@ ScriptPromise SMSReceiver::receive(ScriptState* script_state,
DCHECK(context->IsContextThread());
LocalFrame* frame = GetFrame();
if (!frame) {
exception_state.ThrowDOMException(DOMExceptionCode::kNotSupportedError,
"Script context has shut down.");
return ScriptPromise();
}
if (!frame->IsMainFrame() && frame->IsCrossOriginSubframe()) {
exception_state.ThrowDOMException(
DOMExceptionCode::kNotAllowedError,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment