Commit c05e691a authored by Rouslan Solomakhin's avatar Rouslan Solomakhin Committed by Commit Bot

[Web Payment] Do not update header view when aborting payment.

Before this patch, navigation to an insecure page would update the
header view and remove the header view at the same time, which could
result in a use-after-free.

This patch updates the header view only when not aborting payment.

After this patch, navigation to an insecure page will remove the header
view and not try updating it, thus avoiding the use-after-free.

Bug: 1114556
Change-Id: I946bed36433e3241c6c19c33d7be759ea23a1478
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2351959Reviewed-by: default avatarLiquan (Max) Gu <maxlg@chromium.org>
Commit-Queue: Rouslan Solomakhin <rouslan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#797294}
parent 005a04e3
...@@ -304,9 +304,11 @@ bool PaymentHandlerWebFlowViewController:: ...@@ -304,9 +304,11 @@ bool PaymentHandlerWebFlowViewController::
void PaymentHandlerWebFlowViewController::VisibleSecurityStateChanged( void PaymentHandlerWebFlowViewController::VisibleSecurityStateChanged(
content::WebContents* source) { content::WebContents* source) {
DCHECK_EQ(source, web_contents()); DCHECK_EQ(source, web_contents());
UpdateHeaderView(); if (!SslValidityChecker::IsValidPageInPaymentHandlerWindow(source)) {
if (!SslValidityChecker::IsValidPageInPaymentHandlerWindow(source))
AbortPayment(); AbortPayment();
} else {
UpdateHeaderView();
}
} }
void PaymentHandlerWebFlowViewController::DidStartNavigation( void PaymentHandlerWebFlowViewController::DidStartNavigation(
......
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