From 5edf194493487d464531db0e7fd7df2489603eea Mon Sep 17 00:00:00 2001 From: "thestig@chromium.org" Date: Wed, 26 Sep 2012 17:46:28 +0000 Subject: Fix a parsing error in the Linux dump writer. Review URL: https://breakpad.appspot.com/464002 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1050 4c0a9323-5329-0410-9bdc-e9ce6186880e --- src/client/linux/minidump_writer/minidump_writer.cc | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'src/client') diff --git a/src/client/linux/minidump_writer/minidump_writer.cc b/src/client/linux/minidump_writer/minidump_writer.cc index add2d3f5..02f6c3e2 100644 --- a/src/client/linux/minidump_writer/minidump_writer.cc +++ b/src/client/linux/minidump_writer/minidump_writer.cc @@ -62,9 +62,6 @@ #include -#include "client/minidump_file_writer.h" -#include "google_breakpad/common/minidump_format.h" - #include "client/linux/handler/exception_handler.h" #include "client/linux/minidump_writer/line_reader.h" #include "client/linux/minidump_writer/linux_dumper.h" @@ -1008,7 +1005,8 @@ class MinidumpWriter { for (int i = 0;;) { ElfW(Dyn) dyn; dynamic_length += sizeof(dyn); - dumper_->CopyFromProcess(&dyn, GetCrashThread(), dynamic+i++, sizeof(dyn)); + dumper_->CopyFromProcess(&dyn, GetCrashThread(), dynamic+i++, + sizeof(dyn)); if (dyn.d_tag == DT_DEBUG) { r_debug = reinterpret_cast(dyn.d_un.d_ptr); continue; @@ -1083,7 +1081,7 @@ class MinidumpWriter { debug.get()->ldbase = (void*)debug_entry.r_ldbase; debug.get()->dynamic = dynamic; - char *dso_debug_data = new char[dynamic_length]; + char* dso_debug_data = new char[dynamic_length]; dumper_->CopyFromProcess(dso_debug_data, GetCrashThread(), dynamic, dynamic_length); debug.CopyIndexAfterObject(0, dso_debug_data, dynamic_length); @@ -1210,8 +1208,14 @@ class MinidumpWriter { if (space_ptr != value) continue; + // skip past the colon and all the spaces that follow + do { + value++; + } while (my_isspace(*value)); + uintptr_t val; - my_read_decimal_ptr(&val, ++value); + if (my_read_decimal_ptr(&val, value) == value) + continue; entry->value = static_cast(val); entry->found = true; } @@ -1223,7 +1227,7 @@ class MinidumpWriter { if (!value) goto popline; - // skip ':" and all the spaces that follows + // skip past the colon and all the spaces that follow do { value++; } while (my_isspace(*value)); -- cgit v1.2.1