28 Sep
2024
28 Sep
'24
5:56 p.m.
Esme Povirk (@madewokherd) commented about dlls/mscoree/mscoree_main.c:
} }
+void CDECL mono_log_handler_fn(const char *log_domain, const char *log_level, const char *message, INT fatal, void *user_data) +{ + SIZE_T len = (log_domain ? strlen(log_domain) + 2 : 0) + (message ? strlen(message) : 0) + strlen("\n") + 1; + char *msg = calloc(len, sizeof(char)); + + if (msg) + { + sprintf(msg, "%s%s%s\n", log_domain ? log_domain : "", log_domain ? ": " : "", message);
If message can be NULL as the `len` calculation implies, then we need to handle it here too. But I'd expect that it can't be NULL and calling strlen(message) is fine. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/6572#note_83620