From 28e5990b579f69aaeded6ab4c2b68d841424b4cd Mon Sep 17 00:00:00 2001 From: mmentovai Date: Wed, 6 Dec 2006 05:03:48 +0000 Subject: 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 --- src/processor/minidump.cc | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/processor') 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(&(*cv_record_)[0]); - if (cv_record_70) { + if (cv_record_) { + const MDCVInfoPDB70* cv_record_70 = + reinterpret_cast(&(*cv_record_)[0]); if (cv_record_70->cv_signature == MD_CVINFOPDB70_SIGNATURE) { // GetCVRecord guarantees pdb_file_name is null-terminated. file = reinterpret_cast(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(&(*misc_record_)[0]); - if (misc_record) { + if (misc_record_) { + const MDImageDebugMisc* misc_record = + reinterpret_cast(&(*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(&(*cv_record_)[0]); - if (cv_record_70) { + if (cv_record_) { + const MDCVInfoPDB70* cv_record_70 = + reinterpret_cast(&(*cv_record_)[0]); if (cv_record_70->cv_signature == MD_CVINFOPDB70_SIGNATURE) { char identifier_string[41]; snprintf(identifier_string, sizeof(identifier_string), -- cgit v1.2.1