Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Unified Diff: util/win/process_info_test.cc

Issue 1412243005: win: Validate readability of memory ranges added to minidump (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: . Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « util/win/process_info.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: util/win/process_info_test.cc
diff --git a/util/win/process_info_test.cc b/util/win/process_info_test.cc
index 075f8eb445b74e035b03d90b6455eb2ed370733b..81e5613ed14e5db1ea73cdad4d26462023e797f0 100644
--- a/util/win/process_info_test.cc
+++ b/util/win/process_info_test.cc
@@ -623,6 +623,20 @@ TEST(ProcessInfo, Handles) {
EXPECT_TRUE(found_mapping_handle);
}
+TEST(ProcessInfo, OutOfRangeCheck) {
+ const size_t kAllocationSize = 12345;
+ scoped_ptr<char[]> safe_memory(new char[kAllocationSize]);
+
+ ProcessInfo info;
+ info.Initialize(GetCurrentProcess());
+
+ EXPECT_TRUE(
+ info.LoggingRangeIsFullyReadable(CheckedRange<WinVMAddress, WinVMSize>(
+ reinterpret_cast<WinVMAddress>(safe_memory.get()), kAllocationSize)));
+ EXPECT_FALSE(info.LoggingRangeIsFullyReadable(
+ CheckedRange<WinVMAddress, WinVMSize>(0, 1024)));
+}
+
} // namespace
} // namespace test
} // namespace crashpad
« no previous file with comments | « util/win/process_info.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698