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

Unified Diff: snapshot/win/thread_snapshot_win.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 | « snapshot/win/process_snapshot_win.cc ('k') | util/win/process_info.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: snapshot/win/thread_snapshot_win.cc
diff --git a/snapshot/win/thread_snapshot_win.cc b/snapshot/win/thread_snapshot_win.cc
index 8a0de39e2598cd626fceaff35c36f5016cfe502b..3593a7e1deed5dc4f86d4245b7d2a7372ea277bf 100644
--- a/snapshot/win/thread_snapshot_win.cc
+++ b/snapshot/win/thread_snapshot_win.cc
@@ -41,11 +41,23 @@ bool ThreadSnapshotWin::Initialize(
INITIALIZATION_STATE_SET_INITIALIZING(initialized_);
thread_ = process_reader_thread;
- // TODO(scottmg): Ensure these regions are readable
- // https://code.google.com/p/crashpad/issues/detail?id=59
- stack_.Initialize(
- process_reader, thread_.stack_region_address, thread_.stack_region_size);
- teb_.Initialize(process_reader, thread_.teb_address, thread_.teb_size);
+ if (process_reader->GetProcessInfo().LoggingRangeIsFullyReadable(
+ CheckedRange<WinVMAddress, WinVMSize>(thread_.stack_region_address,
+ thread_.stack_region_size))) {
+ stack_.Initialize(process_reader,
+ thread_.stack_region_address,
+ thread_.stack_region_size);
+ } else {
+ stack_.Initialize(process_reader, 0, 0);
+ }
+
+ if (process_reader->GetProcessInfo().LoggingRangeIsFullyReadable(
+ CheckedRange<WinVMAddress, WinVMSize>(thread_.teb_address,
+ thread_.teb_size))) {
+ teb_.Initialize(process_reader, thread_.teb_address, thread_.teb_size);
+ } else {
+ teb_.Initialize(process_reader, 0, 0);
+ }
#if defined(ARCH_CPU_X86_64)
if (process_reader->Is64Bit()) {
« no previous file with comments | « snapshot/win/process_snapshot_win.cc ('k') | util/win/process_info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698