From: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 11 Aug 2022 17:52:06 +0000 (-0700) Subject: [mono] Ensure exception_message points to a string (#72002) X-Git-Tag: accepted/tizen/unified/20221103.165808~101^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ac0de3e348bc58f49fe3eaa5915ab043df8bb3f9;p=platform%2Fupstream%2Fdotnet%2Fruntime.git [mono] Ensure exception_message points to a string (#72002) Co-authored-by: Stefan Schulze Frielinghaus --- diff --git a/src/mono/mono/eventpipe/ep-rt-mono.c b/src/mono/mono/eventpipe/ep-rt-mono.c index fba1368..f222b09 100644 --- a/src/mono/mono/eventpipe/ep-rt-mono.c +++ b/src/mono/mono/eventpipe/ep-rt-mono.c @@ -3292,10 +3292,14 @@ ep_rt_mono_write_event_exception_thrown (MonoObject *obj) flags |= EXCEPTION_THROWN_FLAGS_IS_CLS_COMPLIANT; if (exception->inner_ex) flags |= EXCEPTION_THROWN_FLAGS_HAS_INNER; - exception_message = ep_rt_utf16_to_utf8_string (mono_string_chars_internal (exception->message), mono_string_length_internal (exception->message)); + if (exception->message) + exception_message = ep_rt_utf16_to_utf8_string (mono_string_chars_internal (exception->message), mono_string_length_internal (exception->message)); hresult = exception->hresult; } + if (exception_message == NULL) + exception_message = g_strdup (""); + if (mono_get_eh_callbacks ()->mono_walk_stack_with_ctx) mono_get_eh_callbacks ()->mono_walk_stack_with_ctx (get_exception_ip_func, NULL, MONO_UNWIND_SIGNAL_SAFE, (void *)&ip);