From 5dbd93a0f8b8a79b00c74fe92a6806a8ff6f5b6f Mon Sep 17 00:00:00 2001 From: Joshua Peraza Date: Fri, 3 Mar 2017 16:09:37 -0800 Subject: [PATCH] Fix segfault when interpreting bad debug_file BUG=chromium:661037 Change-Id: Ia4da0bd9787c232a6a199cfdfccfbed60c2515c2 Reviewed-on: https://chromium-review.googlesource.com/450090 Reviewed-by: Joshua Peraza --- src/processor/minidump.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/processor/minidump.cc b/src/processor/minidump.cc index c9fa4d81..10400047 100644 --- a/src/processor/minidump.cc +++ b/src/processor/minidump.cc @@ -1988,7 +1988,9 @@ string MinidumpModule::debug_file() const { // GetMiscRecord already byte-swapped the data[] field if it contains // UTF-16, so pass false as the swap argument. scoped_ptr new_file(UTF16ToUTF8(string_utf16, false)); - file = *new_file; + if (new_file.get() != nullptr) { + file = *new_file; + } } } }