Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(20)

Issue 1942323002: Fix a used-after-free caused by an unremoved Observer. (Closed)

Created:
4 years, 7 months ago by anthonyvd
Modified:
4 years, 7 months ago
Reviewers:
tommycli
CC:
chromium-reviews, michaelpg+watch-md-settings_chromium.org, dbeam+watch-settings_chromium.org, stevenjb+watch-md-settings_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix a used-after-free caused by an unremoved Observer. ProfileInfoHandler starts observing the ProfileInfoCache when it receives the JavascriptAllowed event and stops on JavascriptDisallowed, which isn't always called. This CL uses ScopedObserver to ensure ProfileInfoHandler instances are never freed without removing themselves as Observers. BUG=607921 Committed: https://crrev.com/7426febf7c71bba00d58289d4066753012a04d81 Cr-Commit-Position: refs/heads/master@{#391320}

Patch Set 1 #

Total comments: 2

Patch Set 2 : Address feedback #

Unified diffs Side-by-side diffs Delta from patch set Stats (+14 lines, -8 lines) Patch
M chrome/browser/ui/webui/settings/profile_info_handler.h View 1 3 chunks +5 lines, -1 line 0 comments Download
M chrome/browser/ui/webui/settings/profile_info_handler.cc View 1 3 chunks +9 lines, -7 lines 0 comments Download

Messages

Total messages: 13 (7 generated)
anthonyvd
Hi tommycli@, Can you please take a look at this CL that fixes a UAF ...
4 years, 7 months ago (2016-05-03 17:19:20 UTC) #4
tommycli
lgtm. Sorry you were assigned to clean up my mess. Thank you for doing it ...
4 years, 7 months ago (2016-05-03 17:23:48 UTC) #5
anthonyvd
No problem at all. Thanks for the quick review! https://codereview.chromium.org/1942323002/diff/1/chrome/browser/ui/webui/settings/profile_info_handler.h File chrome/browser/ui/webui/settings/profile_info_handler.h (right): https://codereview.chromium.org/1942323002/diff/1/chrome/browser/ui/webui/settings/profile_info_handler.h#newcode67 chrome/browser/ui/webui/settings/profile_info_handler.h:67: ...
4 years, 7 months ago (2016-05-03 18:12:10 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1942323002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1942323002/20001
4 years, 7 months ago (2016-05-03 18:12:40 UTC) #9
commit-bot: I haz the power
Committed patchset #2 (id:20001)
4 years, 7 months ago (2016-05-03 19:11:19 UTC) #11
commit-bot: I haz the power
4 years, 7 months ago (2016-05-03 19:12:44 UTC) #13
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/7426febf7c71bba00d58289d4066753012a04d81
Cr-Commit-Position: refs/heads/master@{#391320}

Powered by Google App Engine
This is Rietveld 408576698