[Payment Request] Fixed potential use-after-free of RenderFrameHost.
InstallablePaymentAppCrawler stores a RenderFrameHost raw pointer and uses it in asynchronously when DownloadAndDecodeWebAppIcon() is run as a callback for downloading the web app manifest. This creates a possible use-after-free situation. This CL applies a limited fix: the RenderFrameHost* is converted to its GlobalFrameRoutingId to be stored inside InstallablePaymentAppCrawler. A better fix is to use WeakPtr<RenderFrameHost> everywhere in payments code. However, this requires changing the content public API to expose a RenderFrameHost::GetWeakPtr() method. Since this CL is intended to be merged to M82, this more risky work is left as a followup for crbug.com/1058840. The instantiation of InstallablePaymentAppCrawler happens synchronously with the instantiation of PaymentRequest, the risk of use-after-free as a result of PaymentRequest's storage of RenderFrameHost* is small. Bug: 1061110 Change-Id: I1428c6006201834ee341dd4546bd297116a5f380 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2106387Reviewed-by:Rouslan Solomakhin <rouslan@chromium.org> Commit-Queue: Danyao Wang <danyao@chromium.org> Cr-Commit-Position: refs/heads/master@{#751454}
Showing
Please register or sign in to comment