diff options
author | alexeypa@chromium.org <alexeypa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-20 02:52:28 +0000 |
---|---|---|
committer | alexeypa@chromium.org <alexeypa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-20 02:52:28 +0000 |
commit | e4642bccfa470354c0c3326dc4539898bd5cb2eb (patch) | |
tree | c9e7a05485ac1409b4217d6535752915d8a34319 /base/process_util_win.cc | |
parent | 602542d6a7ea6313321d9badfe232df3daf12cef (diff) | |
download | chromium_src-e4642bccfa470354c0c3326dc4539898bd5cb2eb.zip chromium_src-e4642bccfa470354c0c3326dc4539898bd5cb2eb.tar.gz chromium_src-e4642bccfa470354c0c3326dc4539898bd5cb2eb.tar.bz2 |
Make sure that base::MessagePumpForUI from different modules are isolated from each other and add protection from shatter attacks by placing |this| pointer to the used data associated with the message-only window (instead of blindly trusting the value of WPARAM).
BUG=124091
Review URL: http://codereview.chromium.org/10134001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@133134 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/process_util_win.cc')
-rw-r--r-- | base/process_util_win.cc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/base/process_util_win.cc b/base/process_util_win.cc index 4fab4c6..9b2e100 100644 --- a/base/process_util_win.cc +++ b/base/process_util_win.cc @@ -176,13 +176,14 @@ ProcessHandle GetCurrentProcessHandle() { } HMODULE GetModuleFromAddress(void* address) { - HMODULE hinst = NULL; - if (!::GetModuleHandleExA(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, + HMODULE instance = NULL; + if (!::GetModuleHandleExA(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | + GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, static_cast<char*>(address), - &hinst)) { + &instance)) { NOTREACHED(); } - return hinst; + return instance; } bool OpenProcessHandle(ProcessId pid, ProcessHandle* handle) { |