mscoree: Avoid buffer overflow when mono print handler returns huge string at once.
Signed-off-by: Sebastian Lackner <sebastian@fds-team.de> Signed-off-by: Vincent Povirk <vincent@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
ce53cb4a00
commit
e5404d4bf6
|
@ -272,7 +272,13 @@ static void CDECL mono_shutdown_callback_fn(MonoProfiler *prof)
|
|||
|
||||
static void CDECL mono_print_handler_fn(const char *string, INT is_stdout)
|
||||
{
|
||||
wine_dbg_printf("%s", string);
|
||||
const char *p;
|
||||
for (; *string; string = p)
|
||||
{
|
||||
if ((p = strstr(string, "\n"))) p++;
|
||||
else p = string + strlen(string);
|
||||
wine_dbg_printf("%.*s", (int)(p - string), string);
|
||||
}
|
||||
}
|
||||
|
||||
static HRESULT CLRRuntimeInfo_GetRuntimeHost(CLRRuntimeInfo *This, RuntimeHost **result)
|
||||
|
|
Loading…
Reference in New Issue