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

Unified Diff: src/client/linux/minidump_writer/minidump_writer.cc

Issue 1959643004: Fix stack collection with size limit (Closed) Base URL: https://chromium.googlesource.com/breakpad/breakpad.git@master
Patch Set: Created 4 years, 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/client/linux/minidump_writer/minidump_writer.cc
diff --git a/src/client/linux/minidump_writer/minidump_writer.cc b/src/client/linux/minidump_writer/minidump_writer.cc
index f407caa72c3b4ba8517dc9e85f7d06f7e1da8e67..abd74508d7cda6a2a73d75e6caa25b77b343d880 100644
--- a/src/client/linux/minidump_writer/minidump_writer.cc
+++ b/src/client/linux/minidump_writer/minidump_writer.cc
@@ -275,6 +275,12 @@ class MinidumpWriter {
if (max_stack_len >= 0 &&
stack_len > static_cast<unsigned int>(max_stack_len)) {
stack_len = max_stack_len;
+ // Skip empty chunks of length max_stack_len.
+ uintptr_t int_stack = reinterpret_cast<uintptr_t>(stack);
+ while (int_stack + max_stack_len < stack_pointer) {
ivanpe 2016/05/17 01:03:10 Please, remove the extra blank after '+'
lv 2016/05/23 15:54:57 Done.
+ int_stack += max_stack_len;
ivanpe 2016/05/17 01:03:10 This will be an infinite loop when max_stack_len =
lv 2016/05/23 15:54:57 I added an additional check. I don't think anyone
+ }
+ stack = reinterpret_cast<const void*>(int_stack);
}
if (!memory.Allocate(stack_len))
return false;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698