summaryrefslogtreecommitdiffstats
path: root/sandbox/win/src
diff options
context:
space:
mode:
authorrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-27 00:56:53 +0000
committerrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-27 00:56:53 +0000
commit50b8dfe92b212d862a79da28965d38bf618132c1 (patch)
tree2e6121ee7bbb09d04e9a7110468fc1dc893d9cd9 /sandbox/win/src
parent9c264eb2d1f366bac9f15d43bd9e35aee47a6ba6 (diff)
downloadchromium_src-50b8dfe92b212d862a79da28965d38bf618132c1.zip
chromium_src-50b8dfe92b212d862a79da28965d38bf618132c1.tar.gz
chromium_src-50b8dfe92b212d862a79da28965d38bf618132c1.tar.bz2
Sandbox: Verify the return value when changing memory protection.
BUG=162073 TEST=none git-svn-id: svn://svn.chromium.org/chrome/trunk/src@169545 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sandbox/win/src')
-rw-r--r--sandbox/win/src/eat_resolver.cc4
-rw-r--r--sandbox/win/src/sidestep_resolver.cc4
2 files changed, 6 insertions, 2 deletions
diff --git a/sandbox/win/src/eat_resolver.cc b/sandbox/win/src/eat_resolver.cc
index 8e81820..154bfcf 100644
--- a/sandbox/win/src/eat_resolver.cc
+++ b/sandbox/win/src/eat_resolver.cc
@@ -41,7 +41,9 @@ NTSTATUS EatResolverThunk::Setup(const void* target_module,
return STATUS_BUFFER_TOO_SMALL;
AutoProtectMemory memory;
- memory.ChangeProtection(eat_entry_, sizeof(DWORD), PAGE_READWRITE);
+ ret = memory.ChangeProtection(eat_entry_, sizeof(DWORD), PAGE_READWRITE);
+ if (!NT_SUCCESS(ret))
+ return ret;
// Perform the patch.
#pragma warning(push)
diff --git a/sandbox/win/src/sidestep_resolver.cc b/sandbox/win/src/sidestep_resolver.cc
index 47c0f56..828c000 100644
--- a/sandbox/win/src/sidestep_resolver.cc
+++ b/sandbox/win/src/sidestep_resolver.cc
@@ -49,7 +49,9 @@ NTSTATUS SidestepResolverThunk::Setup(const void* target_module,
return STATUS_BUFFER_TOO_SMALL;
AutoProtectMemory memory;
- memory.ChangeProtection(target_, kSizeOfSidestepStub, PAGE_READWRITE);
+ ret = memory.ChangeProtection(target_, kSizeOfSidestepStub, PAGE_READWRITE);
+ if (!NT_SUCCESS(ret))
+ return ret;
sidestep::SideStepError rv = sidestep::PreamblePatcher::Patch(
target_, reinterpret_cast<void*>(&thunk->internal_thunk), thunk_storage,