Initialized rect with zeros
authorSeppe Stas <seppestas@gmail.com>
Mon, 8 Jun 2015 17:07:46 +0000 (19:07 +0200)
committerSeppe Stas <seppestas@gmail.com>
Mon, 8 Jun 2015 17:07:46 +0000 (19:07 +0200)
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

index 473a2bc..955a047 100644 (file)
@@ -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));