Commit ee6db233 authored by Andrew Grieve's avatar Andrew Grieve Committed by Commit Bot

Android: Fix malformed minidump when firebase id isn't set

Bug: 828404
Change-Id: Ie327e93f391376fd77cae2df998a921b4a9f0002
Reviewed-on: https://chromium-review.googlesource.com/1002873Reviewed-by: default avatarScott Graham <scottmg@chromium.org>
Commit-Queue: agrieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/master@{#549237}
parent 8d642d00
...@@ -559,10 +559,6 @@ void CrashReporterWriter::AddFileContents(const char* filename_msg, ...@@ -559,10 +559,6 @@ void CrashReporterWriter::AddFileContents(const char* filename_msg,
// $FIREBASE_APP_ID v$VERSION_CODE ($VERSION_NAME) // $FIREBASE_APP_ID v$VERSION_CODE ($VERSION_NAME)
void WriteAndroidPackage(MimeWriter& writer, void WriteAndroidPackage(MimeWriter& writer,
base::android::BuildInfo* android_build_info) { base::android::BuildInfo* android_build_info) {
// Don't write the field if no Firebase ID is set.
if (android_build_info->firebase_app_id()[0] == '\0') {
return;
}
// The actual size limits on packageId and versionName are quite generous. // The actual size limits on packageId and versionName are quite generous.
// Limit to a reasonable size rather than allocating theoretical limits. // Limit to a reasonable size rather than allocating theoretical limits.
const int kMaxSize = 1024; const int kMaxSize = 1024;
...@@ -1745,8 +1741,11 @@ void HandleCrashDump(const BreakpadInfo& info) { ...@@ -1745,8 +1741,11 @@ void HandleCrashDump(const BreakpadInfo& info) {
writer.AddPairString(resources_version, writer.AddPairString(resources_version,
android_build_info->resources_version()); android_build_info->resources_version());
writer.AddBoundary(); writer.AddBoundary();
WriteAndroidPackage(writer, android_build_info); // Don't write the field if no Firebase ID is set.
writer.AddBoundary(); if (android_build_info->firebase_app_id()[0] != '\0') {
WriteAndroidPackage(writer, android_build_info);
writer.AddBoundary();
}
if (android_build_info->java_exception_info() != nullptr) { if (android_build_info->java_exception_info() != nullptr) {
writer.AddPairString(exception_info, writer.AddPairString(exception_info,
android_build_info->java_exception_info()); android_build_info->java_exception_info());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment