aboutsummaryrefslogtreecommitdiff
path: root/src/processor
diff options
context:
space:
mode:
authormmentovai <mmentovai@4c0a9323-5329-0410-9bdc-e9ce6186880e>2006-12-06 05:03:48 +0000
committermmentovai <mmentovai@4c0a9323-5329-0410-9bdc-e9ce6186880e>2006-12-06 05:03:48 +0000
commit28e5990b579f69aaeded6ab4c2b68d841424b4cd (patch)
treef17cf1c3fc7a421299c43a0d7d5fc770f95dcee7 /src/processor
parentUpdate reporting strings for exceptions (Issue 88) (diff)
downloadbreakpad-28e5990b579f69aaeded6ab4c2b68d841424b4cd.tar.xz
Fix possible null pointer dereference in MinidumpModule (following #32).
r=waylonis http://groups.google.com/group/airbag-dev/browse_thread/thread/b684b775078d91ca git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@76 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/processor')
-rw-r--r--src/processor/minidump.cc18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/processor/minidump.cc b/src/processor/minidump.cc
index 9ffbc1d0..cce8549b 100644
--- a/src/processor/minidump.cc
+++ b/src/processor/minidump.cc
@@ -1146,9 +1146,9 @@ string MinidumpModule::debug_file() const {
string file;
// Prefer the CodeView record if present.
- const MDCVInfoPDB70* cv_record_70 =
- reinterpret_cast<const MDCVInfoPDB70*>(&(*cv_record_)[0]);
- if (cv_record_70) {
+ if (cv_record_) {
+ const MDCVInfoPDB70* cv_record_70 =
+ reinterpret_cast<const MDCVInfoPDB70*>(&(*cv_record_)[0]);
if (cv_record_70->cv_signature == MD_CVINFOPDB70_SIGNATURE) {
// GetCVRecord guarantees pdb_file_name is null-terminated.
file = reinterpret_cast<const char*>(cv_record_70->pdb_file_name);
@@ -1169,9 +1169,9 @@ string MinidumpModule::debug_file() const {
if (file.empty()) {
// No usable CodeView record. Try the miscellaneous debug record.
- const MDImageDebugMisc* misc_record =
- reinterpret_cast<const MDImageDebugMisc *>(&(*misc_record_)[0]);
- if (misc_record) {
+ if (misc_record_) {
+ const MDImageDebugMisc* misc_record =
+ reinterpret_cast<const MDImageDebugMisc *>(&(*misc_record_)[0]);
if (!misc_record->unicode) {
// If it's not Unicode, just stuff it into the string. It's unclear
// if misc_record->data is 0-terminated, so use an explicit size.
@@ -1216,9 +1216,9 @@ string MinidumpModule::debug_identifier() const {
string identifier;
// Use the CodeView record if present.
- const MDCVInfoPDB70* cv_record_70 =
- reinterpret_cast<const MDCVInfoPDB70*>(&(*cv_record_)[0]);
- if (cv_record_70) {
+ if (cv_record_) {
+ const MDCVInfoPDB70* cv_record_70 =
+ reinterpret_cast<const MDCVInfoPDB70*>(&(*cv_record_)[0]);
if (cv_record_70->cv_signature == MD_CVINFOPDB70_SIGNATURE) {
char identifier_string[41];
snprintf(identifier_string, sizeof(identifier_string),