Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions libobs/obs-win-crash-handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,14 +221,24 @@ static BOOL CALLBACK enum_all_modules(PCTSTR module_name, DWORD64 module_base, U
dstr_copy(&data->module_name, name_utf8);
strlwr(data->module_name.array);
}

struct win_version_info ver = {0};
if (get_dll_ver(module_name, &ver)) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

get_dll_ver calls bmalloc which is unsafe to use in a crashing path (crash could be due to OOM).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The dstr calls in this function also use brealloc, should that all be refactored? And if so that would be something for a separate pull request in my opinion.

#ifdef _WIN64
dstr_catf(&data->module_list, "%016" PRIX64 "-%016" PRIX64 " %s (%d.%d.%d.%d)\r\n", module_base,
module_base + module_size, name_utf8, ver.major, ver.minor, ver.build, ver.revis);
#else
dstr_catf(&data->module_list, "%08" PRIX64 "-%08" PRIX64 " %s (%d.%d.%d.%d)\r\n", module_base,
module_base + module_size, name_utf8, ver.major, ver.minor, ver.build, ver.revis);
#endif
} else {
#ifdef _WIN64
dstr_catf(&data->module_list, "%016" PRIX64 "-%016" PRIX64 " %s\r\n", module_base, module_base + module_size,
name_utf8);
dstr_catf(&data->module_list, "%016" PRIX64 "-%016" PRIX64 " %s\r\n", module_base,
module_base + module_size, name_utf8);
#else
dstr_catf(&data->module_list, "%08" PRIX64 "-%08" PRIX64 " %s\r\n", module_base, module_base + module_size,
name_utf8);
dstr_catf(&data->module_list, "%08" PRIX64 "-%08" PRIX64 " %s\r\n", module_base,
module_base + module_size, name_utf8);
#endif
}
return true;
}

Expand Down