Skip to content

Commit 2e4a0b0

Browse files
author
brianradunity
authored
Merge pull request #1000 from Unity-Technologies/debugger-get-string-value-assert-fix
Remove assert when retrieving value of string with invalid chars
2 parents bc79e76 + 6307b9b commit 2e4a0b0

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

mono/mini/debugger-agent.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11456,7 +11456,13 @@ string_commands (int command, guint8 *p, guint8 *end, Buffer *buf)
1145611456
} else {
1145711457
MonoError error;
1145811458
s = mono_string_to_utf8_checked (str, &error);
11459-
mono_error_assert_ok (&error);
11459+
if (!mono_error_ok (&error)) {
11460+
if (s)
11461+
g_free (s);
11462+
11463+
return ERR_INVALID_ARGUMENT;
11464+
}
11465+
1146011466
buffer_add_string (buf, s);
1146111467
g_free (s);
1146211468
}

0 commit comments

Comments
 (0)