Commit 7d1acb93 authored by rdevlin.cronin's avatar rdevlin.cronin Committed by Commit bot

[Extensions] Fix use-after-free in the developer private API.

BUG=482112

Review URL: https://codereview.chromium.org/1112693002

Cr-Commit-Position: refs/heads/master@{#327373}
parent 820c0714
...@@ -508,12 +508,13 @@ void ExtensionInfoGenerator::OnImageLoaded( ...@@ -508,12 +508,13 @@ void ExtensionInfoGenerator::OnImageLoaded(
--pending_image_loads_; --pending_image_loads_;
if (pending_image_loads_ == 0) { // All done! if (pending_image_loads_ == 0) { // All done!
// We assign to a temporary and Reset() so that at the end of the method, // We assign to a temporary callback and list and reset the stored values so
// any stored refs are destroyed. // that at the end of the method, any stored refs are destroyed.
ExtensionInfoList list;
list.swap(list_);
ExtensionInfosCallback callback = callback_; ExtensionInfosCallback callback = callback_;
callback_.Reset(); callback_.Reset();
callback.Run(list_); callback.Run(list); // WARNING: |this| is possibly deleted after this line!
list_.clear();
} }
} }
......
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