summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjschuh@chromium.org <jschuh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-28 15:37:27 +0000
committerjschuh@chromium.org <jschuh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-28 15:37:27 +0000
commit9df9cb844cae339257bd5d6dbb3b5cd9da8b748d (patch)
treecf920eb3b8c6afcebc7879cef37ffe143bf81f60
parente8fde446ba8b938551f8dec71764d5f2658d124b (diff)
downloadchromium_src-9df9cb844cae339257bd5d6dbb3b5cd9da8b748d.zip
chromium_src-9df9cb844cae339257bd5d6dbb3b5cd9da8b748d.tar.gz
chromium_src-9df9cb844cae339257bd5d6dbb3b5cd9da8b748d.tar.bz2
Fix masking error in InterceptionManager::PatchNtdll
BUG=344415 R=rvargas TBR=rvargas NOTRY=true Review URL: https://codereview.chromium.org/215363005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@260135 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--sandbox/win/src/interception.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/sandbox/win/src/interception.cc b/sandbox/win/src/interception.cc
index dde5857..597b937 100644
--- a/sandbox/win/src/interception.cc
+++ b/sandbox/win/src/interception.cc
@@ -399,7 +399,7 @@ bool InterceptionManager::PatchNtdll(bool hot_patch_needed) {
thunk_offset &= kPageSize - 1;
// Make an aligned, padded allocation, and move the pointer to our chunk.
- size_t thunk_bytes_padded = (thunk_bytes + kPageSize - 1) & kPageSize;
+ size_t thunk_bytes_padded = (thunk_bytes + kPageSize - 1) & ~(kPageSize - 1);
thunk_base = reinterpret_cast<BYTE*>(
::VirtualAllocEx(child, thunk_base, thunk_bytes_padded,
MEM_COMMIT, PAGE_EXECUTE_READWRITE));