From de2c055770751e7ffc42be3f97c5c7a3a99f9056 Mon Sep 17 00:00:00 2001 From: "SiyangXie@gmail.com" Date: Thu, 30 Sep 2010 00:05:25 +0000 Subject: Fix a segmentation fault bug in MinidumpAssertion::Read(). git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@702 4c0a9323-5329-0410-9bdc-e9ce6186880e --- src/processor/minidump.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/processor/minidump.cc b/src/processor/minidump.cc index 0414a822..f57001a2 100644 --- a/src/processor/minidump.cc +++ b/src/processor/minidump.cc @@ -2935,7 +2935,8 @@ bool MinidumpAssertion::Read(u_int32_t expected_size) { scoped_ptr new_expression(UTF16ToUTF8(expression_utf16, minidump_->swap())); - expression_ = *new_expression; + if (new_expression.get()) + expression_ = *new_expression; } // assertion @@ -2947,7 +2948,8 @@ bool MinidumpAssertion::Read(u_int32_t expected_size) { memcpy(&function_utf16[0], &assertion_.function[0], byte_length); scoped_ptr new_function(UTF16ToUTF8(function_utf16, minidump_->swap())); - function_ = *new_function; + if (new_function.get()) + function_ = *new_function; } // file @@ -2959,7 +2961,8 @@ bool MinidumpAssertion::Read(u_int32_t expected_size) { memcpy(&file_utf16[0], &assertion_.file[0], byte_length); scoped_ptr new_file(UTF16ToUTF8(file_utf16, minidump_->swap())); - file_ = *new_file; + if (new_file.get()) + file_ = *new_file; } if (minidump_->swap()) { -- cgit v1.2.1