aboutsummaryrefslogtreecommitdiff
path: root/src/processor
diff options
context:
space:
mode:
Diffstat (limited to 'src/processor')
-rw-r--r--src/processor/minidump_processor.cc7
-rw-r--r--src/processor/synth_minidump.cc2
2 files changed, 6 insertions, 3 deletions
diff --git a/src/processor/minidump_processor.cc b/src/processor/minidump_processor.cc
index 4ea4cb70..a90e6188 100644
--- a/src/processor/minidump_processor.cc
+++ b/src/processor/minidump_processor.cc
@@ -31,6 +31,7 @@
#include <assert.h>
+#include <algorithm>
#include <string>
#include "common/scoped_ptr.h"
@@ -128,8 +129,10 @@ ProcessResult MinidumpProcessor::Process(
process_state->exception_record_.set_nested_exception_record_address(
exception->exception()->exception_record.exception_record);
process_state->exception_record_.set_address(process_state->crash_address_);
- for (uint32_t i = 0;
- i < exception->exception()->exception_record.number_parameters; i++) {
+ const uint32_t num_parameters =
+ std::min(exception->exception()->exception_record.number_parameters,
+ MD_EXCEPTION_MAXIMUM_PARAMETERS);
+ for (uint32_t i = 0; i < num_parameters; ++i) {
process_state->exception_record_.add_parameter(
exception->exception()->exception_record.exception_information[i],
// TODO(ivanpe): Populate description.
diff --git a/src/processor/synth_minidump.cc b/src/processor/synth_minidump.cc
index aa86d248..5e72c161 100644
--- a/src/processor/synth_minidump.cc
+++ b/src/processor/synth_minidump.cc
@@ -332,7 +332,7 @@ Exception::Exception(const Dump &dump,
D64(exception_address);
D32(0); // number_parameters
D32(0); // __align
- for (int i = 0; i < MD_EXCEPTION_MAXIMUM_PARAMETERS; ++i)
+ for (size_t i = 0; i < MD_EXCEPTION_MAXIMUM_PARAMETERS; ++i)
D64(0); // exception_information
context.CiteLocationIn(this);
assert(Size() == sizeof(MDRawExceptionStream));