diff options
author | rvargas@chromium.org <rvargas@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-27 01:03:43 +0000 |
---|---|---|
committer | rvargas@chromium.org <rvargas@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-27 01:03:43 +0000 |
commit | 166a865e356b1841a1e3bf3b32bc5aaf13215f6e (patch) | |
tree | 6aeefbef7ebeb5eb1a232b6c88645da240d73a79 /remoting/host/desktop_session_proxy.cc | |
parent | 4cb7699e349fabe62f9b4af7894361c4334161f9 (diff) | |
download | chromium_src-166a865e356b1841a1e3bf3b32bc5aaf13215f6e.zip chromium_src-166a865e356b1841a1e3bf3b32bc5aaf13215f6e.tar.gz chromium_src-166a865e356b1841a1e3bf3b32bc5aaf13215f6e.tar.bz2 |
Base: Remove Receive() from ScopedHandle.
In general, the OS API contract doesn't guarantee that output variables are
not modified on failure, so a Reeceive pattern is fundamentally insecure.
BUG=318531
TEST=current tests
tbr'ing owners for the consumers.
TBR=jvoung@chromium.org, thakis@chromium.org, sergeyu@chromium.org, grt@chromium.org, gene@chromium.org, youngki@chromium.org
Review URL: https://codereview.chromium.org/71013004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@237459 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/host/desktop_session_proxy.cc')
-rw-r--r-- | remoting/host/desktop_session_proxy.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/remoting/host/desktop_session_proxy.cc b/remoting/host/desktop_session_proxy.cc index 9e52f8d..058a2f4 100644 --- a/remoting/host/desktop_session_proxy.cc +++ b/remoting/host/desktop_session_proxy.cc @@ -230,9 +230,9 @@ bool DesktopSessionProxy::AttachToDesktop( #if defined(OS_WIN) // On Windows: |desktop_process| is a valid handle, but |desktop_pipe| needs // to be duplicated from the desktop process. - base::win::ScopedHandle pipe; + HANDLE temp_handle; if (!DuplicateHandle(desktop_process_, desktop_pipe, GetCurrentProcess(), - pipe.Receive(), 0, FALSE, DUPLICATE_SAME_ACCESS)) { + &temp_handle, 0, FALSE, DUPLICATE_SAME_ACCESS)) { LOG_GETLASTERROR(ERROR) << "Failed to duplicate the desktop-to-network" " pipe handle"; @@ -240,6 +240,7 @@ bool DesktopSessionProxy::AttachToDesktop( base::CloseProcessHandle(desktop_process); return false; } + base::win::ScopedHandle pipe(temp_handle); IPC::ChannelHandle desktop_channel_handle(pipe); |