Skip to content

Commit

Permalink
[mono] Ensure exception_message points to a string (#66991)
Browse files Browse the repository at this point in the history
  • Loading branch information
stefan-sf-ibm committed Mar 24, 2022
1 parent 2bf30a0 commit 0e35b8d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/mono/mono/eventpipe/ep-rt-mono.c
Original file line number Diff line number Diff line change
Expand Up @@ -3479,10 +3479,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);

Expand Down

0 comments on commit 0e35b8d

Please sign in to comment.