From 1b5254e49ae00ce206a6f91ae149eefef04b52c6 Mon Sep 17 00:00:00 2001 From: George Wright Date: Wed, 18 Mar 2020 13:08:54 -0700 Subject: [PATCH] Truncate error messages for the crash reporter to the maximum length permitted by the FIDL call (flutter/engine#17189) --- .../platform/fuchsia/runtime/dart/utils/handle_exception.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/engine/src/flutter/shell/platform/fuchsia/runtime/dart/utils/handle_exception.cc b/engine/src/flutter/shell/platform/fuchsia/runtime/dart/utils/handle_exception.cc index 6785a1220e..3ef03565d9 100644 --- a/engine/src/flutter/shell/platform/fuchsia/runtime/dart/utils/handle_exception.cc +++ b/engine/src/flutter/shell/platform/fuchsia/runtime/dart/utils/handle_exception.cc @@ -64,6 +64,11 @@ fuchsia::feedback::CrashReport BuildCrashReport( error.substr(delimiter_pos + 2 /*to get rid of the leading ': '*/); } + // Truncate error message to the maximum length allowed for the crash_reporter + // FIDL call + error_message = error_message.substr( + 0, fuchsia::feedback::MAX_EXCEPTION_MESSAGE_LENGTH - 1); + fuchsia::feedback::RuntimeCrashReport dart_report; dart_report.set_exception_type(error_type); dart_report.set_exception_message(error_message);