From ca3b98e45494008970160b12fd2b7b8253567591 Mon Sep 17 00:00:00 2001 From: zeffy Date: Fri, 2 Mar 2018 21:24:40 -0800 Subject: [PATCH] fixed printing to wrong buffer causing crash --- src/wufuc/log.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/wufuc/log.c b/src/wufuc/log.c index cd71239..4088036 100644 --- a/src/wufuc/log.c +++ b/src/wufuc/log.c @@ -30,7 +30,8 @@ void logp_debug_write(const wchar_t *const format, ...) count = _scwprintf(fmt, datebuf, timebuf, exename, pid, buffer1) + 1; buffer2 = calloc(count, sizeof *buffer2); - swprintf_s(buffer1, count, fmt, datebuf, timebuf, exename, pid, buffer1); + swprintf_s(buffer2, count, fmt, datebuf, timebuf, exename, pid, buffer1); + free(buffer1); OutputDebugStringW(buffer2); free(buffer2);