aboutsummaryrefslogtreecommitdiff
path: root/src/processor
diff options
context:
space:
mode:
authorTed Mielczarek <ted@mielczarek.org>2016-02-17 06:20:58 -0500
committerTed Mielczarek <ted@mielczarek.org>2016-02-17 06:20:58 -0500
commit7b25f7081342804f1a7bcf5300e45598bffc3543 (patch)
treedd93f9c4b31e470f3d2b46fcd7358dd84f0ae95e /src/processor
parentlinux_dumper_unittest_helper: move to a check-only binary (diff)
downloadbreakpad-7b25f7081342804f1a7bcf5300e45598bffc3543.tar.xz
Fix buffer overrun in MinidumpModule::debug_identifier with MDCVInfoELF
Diffstat (limited to 'src/processor')
-rw-r--r--src/processor/minidump.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/processor/minidump.cc b/src/processor/minidump.cc
index a9b56a50..90311376 100644
--- a/src/processor/minidump.cc
+++ b/src/processor/minidump.cc
@@ -47,6 +47,7 @@
#include <unistd.h>
#endif // _WIN32
+#include <algorithm>
#include <fstream>
#include <iostream>
#include <limits>
@@ -2054,7 +2055,8 @@ string MinidumpModule::debug_identifier() const {
// The full build id is available by calling code_identifier.
MDGUID guid = {0};
memcpy(&guid, &cv_record_elf->build_id,
- cv_record_->size() - MDCVInfoELF_minsize);
+ std::min(cv_record_->size() - MDCVInfoELF_minsize,
+ sizeof(MDGUID)));
identifier = guid_and_age_to_debug_id(guid, 0);
}
}