diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-18 20:05:20 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-18 20:05:20 +0000 |
commit | 2eabe6699f7c3fea4ada9ec3e411719b68acf68b (patch) | |
tree | 7299642153eefbdbd77922ca3c78c2150a998a5a /ui/base | |
parent | 16e35620f4159d7ae4b626eda3f82ac43978d3cd (diff) | |
download | chromium_src-2eabe6699f7c3fea4ada9ec3e411719b68acf68b.zip chromium_src-2eabe6699f7c3fea4ada9ec3e411719b68acf68b.tar.gz chromium_src-2eabe6699f7c3fea4ada9ec3e411719b68acf68b.tar.bz2 |
Merge 85784 - Fix a Chrome browser crash which occurs when running the browser as part of ChromeFrame. The crash
occurs while casting the GWLP_USERDATA pointer from a window owned by IE to a WidgetWin pointer and
dereferencing it. We arrive at the IE window while enumerating the parents of the ExternalTabContainer window.
BUG=none
TEST=chrome frame tests should not crash
Review URL: http://codereview.chromium.org/7043008
TBR=ananta@chromium.org
Review URL: http://codereview.chromium.org/7039046
git-svn-id: svn://svn.chromium.org/chrome/branches/742/src@85801 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/base')
-rw-r--r-- | ui/base/win/hwnd_util.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/ui/base/win/hwnd_util.cc b/ui/base/win/hwnd_util.cc index 6277b27..e71dac8 100644 --- a/ui/base/win/hwnd_util.cc +++ b/ui/base/win/hwnd_util.cc @@ -82,6 +82,11 @@ void* SetWindowUserData(HWND hwnd, void* user_data) { } void* GetWindowUserData(HWND hwnd) { + DWORD process_id = 0; + DWORD thread_id = GetWindowThreadProcessId(hwnd, &process_id); + // A window outside the current process needs to be ignored. + if (process_id != ::GetCurrentProcessId()) + return NULL; return reinterpret_cast<void*>(GetWindowLongPtr(hwnd, GWLP_USERDATA)); } |