fix: uaf in WebContents::DidStopLoading (#26702)

This commit is contained in:
Jeremy Rose 2020-11-29 21:03:07 -08:00 committed by GitHub
parent 7cc571801c
commit 770e245de5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1447,12 +1447,12 @@ void WebContents::DidStartLoading() {
}
void WebContents::DidStopLoading() {
Emit("did-stop-loading");
auto* web_preferences = WebContentsPreferences::From(web_contents());
if (web_preferences &&
web_preferences->IsEnabled(options::kEnablePreferredSizeMode))
web_contents()->GetRenderViewHost()->EnablePreferredSizeMode();
Emit("did-stop-loading");
}
bool WebContents::EmitNavigationEvent(