From cac97cca0da04513edd33614af910b803b1a39cb Mon Sep 17 00:00:00 2001 From: Seppe Stas Date: Mon, 8 Jun 2015 19:07:46 +0200 Subject: [PATCH] Initialized rect with zeros As per @zcbenz 's remark: The rect should be initialized with zeros to prevent random values being passed to the click event handler when `Shell_NotifyIconGetRect` fails. --- atom/browser/ui/win/notify_icon.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/atom/browser/ui/win/notify_icon.cc b/atom/browser/ui/win/notify_icon.cc index 473a2bcac8d4..955a047fe1f5 100644 --- a/atom/browser/ui/win/notify_icon.cc +++ b/atom/browser/ui/win/notify_icon.cc @@ -55,7 +55,7 @@ void NotifyIcon::HandleClickEvent(const gfx::Point& cursor_pos, icon_id.hWnd = window_; icon_id.cbSize = sizeof(NOTIFYICONIDENTIFIER); - RECT rect; + RECT rect = { 0 }; Shell_NotifyIconGetRect(&icon_id, &rect); NotifyClicked(gfx::Rect(rect));