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

Unified Diff: util/win/process_info.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.h ('k') | util/win/process_info_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: util/win/process_info.cc
diff --git a/util/win/process_info.cc b/util/win/process_info.cc
index 7f3ff286c1dd0e6cf4c209407707b563a5327076..1478d044a9fe2171da4b0c0565502b2224092874 100644
--- a/util/win/process_info.cc
+++ b/util/win/process_info.cc
@@ -600,6 +600,26 @@ ProcessInfo::GetReadableRanges(
return GetReadableRangesOfMemoryMap(range, MemoryInfo());
}
+bool ProcessInfo::LoggingRangeIsFullyReadable(
+ const CheckedRange<WinVMAddress, WinVMSize>& range) const {
+ const auto ranges = GetReadableRanges(range);
+ if (ranges.size() != 1) {
+ LOG(ERROR) << base::StringPrintf(
+ "range at 0x%llx, size 0x%llx fully unreadable",
+ range.base(),
+ range.size());
+ return false;
+ }
+ if (ranges[0].base() != range.base() || ranges[0].size() != range.size()) {
+ LOG(ERROR) << base::StringPrintf(
+ "some of range at 0x%llx, size 0x%llx unreadable",
+ range.base(),
+ range.size());
+ return false;
+ }
+ return true;
+}
+
const std::vector<ProcessInfo::Handle>& ProcessInfo::Handles() const {
INITIALIZATION_STATE_DCHECK_VALID(initialized_);
if (handles_.empty())
« no previous file with comments | « util/win/process_info.h ('k') | util/win/process_info_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698