diff options
author | rsesek@chromium.org <rsesek@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-12 04:00:04 +0000 |
---|---|---|
committer | rsesek@chromium.org <rsesek@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-12 04:00:04 +0000 |
commit | a8811ca1edfccbf8988d845b256e4d8d9208f982 (patch) | |
tree | aa13f60852757b8db151a33a05d6ed076fc7bd8e | |
parent | d8dd456c44c6734daa90a104da58cdffe16a5842 (diff) | |
download | chromium_src-a8811ca1edfccbf8988d845b256e4d8d9208f982.zip chromium_src-a8811ca1edfccbf8988d845b256e4d8d9208f982.tar.gz chromium_src-a8811ca1edfccbf8988d845b256e4d8d9208f982.tar.bz2 |
[Mac][MC] Use the copied notification ID when notifying the MessageCenter.
Dereferencing the Notification object may result in a use-after-free.
BUG=248512
Review URL: https://chromiumcodereview.appspot.com/16780005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@205714 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | ui/message_center/cocoa/notification_controller.mm | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ui/message_center/cocoa/notification_controller.mm b/ui/message_center/cocoa/notification_controller.mm index e8b3eee..75f9b22f 100644 --- a/ui/message_center/cocoa/notification_controller.mm +++ b/ui/message_center/cocoa/notification_controller.mm @@ -369,11 +369,12 @@ } - (void)close:(id)sender { - messageCenter_->RemoveNotification(notification_->id(), /*by_user=*/true); + messageCenter_->RemoveNotification([self notificationID], /*by_user=*/true); } - (void)buttonClicked:(id)button { - messageCenter_->ClickOnNotificationButton(notification_->id(), [button tag]); + messageCenter_->ClickOnNotificationButton([self notificationID], + [button tag]); } - (const message_center::Notification*)notification { |