Skip to content

Commit

Permalink
metadata: Fix bounds checking in mono_guid_signature_append_type.
Browse files Browse the repository at this point in the history
  • Loading branch information
madewokherd committed Feb 3, 2024
1 parent 6d86ad8 commit 2a492b6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mono/metadata/metadata.c
Original file line number Diff line number Diff line change
Expand Up @@ -8205,7 +8205,8 @@ mono_guid_signature_append_type (GString *res, MonoType *type)
for (i = 0; i < type->data.array->rank; ++i)
{
if (i > 0) g_string_append_c (res, ',');
if (type->data.array->sizes[i] == 0 || type->data.array->lobounds[i] == 0) continue;
if (i >= type->data.array->numsizes || type->data.array->sizes[i] == 0 ||
i >= type->data.array->numlobounds || type->data.array->lobounds[i] == 0) continue;
g_string_append_printf (res, "%d", type->data.array->lobounds[i]);
g_string_append (res, "...");
g_string_append_printf (res, "%d", type->data.array->lobounds[i] + type->data.array->sizes[i] + 1);
Expand Down

0 comments on commit 2a492b6

Please sign in to comment.