Skip to content

Commit

Permalink
[mono][debugger] Fixing AV on accessing source_file_list that is NULL (
Browse files Browse the repository at this point in the history
…dotnet#105781)

* Fixing AV on accessing source_file_list that is NULL
  • Loading branch information
thaystg authored Aug 1, 2024
1 parent be32947 commit 9fe8c95
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions src/mono/mono/component/debugger-agent.c
Original file line number Diff line number Diff line change
Expand Up @@ -6752,16 +6752,18 @@ get_source_files_for_type (MonoClass *klass)

if (minfo) {
mono_debug_get_seq_points (minfo, NULL, &source_file_list, NULL, NULL, NULL);
for (guint j = 0; j < source_file_list->len; ++j) {
guint i;
sinfo = (MonoDebugSourceInfo *)g_ptr_array_index (source_file_list, j);
for (i = 0; i < files->len; ++i)
if (!strcmp ((const char*)g_ptr_array_index (files, i), (const char*)sinfo->source_file))
break;
if (i == files->len)
g_ptr_array_add (files, g_strdup (sinfo->source_file));
}
g_ptr_array_free (source_file_list, TRUE);
if (source_file_list != NULL) {
for (guint j = 0; j < source_file_list->len; ++j) {
guint i;
sinfo = (MonoDebugSourceInfo *)g_ptr_array_index (source_file_list, j);
for (i = 0; i < files->len; ++i)
if (!strcmp ((const char*)g_ptr_array_index (files, i), (const char*)sinfo->source_file))
break;
if (i == files->len)
g_ptr_array_add (files, g_strdup (sinfo->source_file));
}
g_ptr_array_free (source_file_list, TRUE);
}
}
}

Expand Down

0 comments on commit 9fe8c95

Please sign in to comment.