[PATCH 1/5] reg.exe: Fix stack overflow on large registry keys
Jonathan Vollebregt
jnvsor at gmail.com
Mon Sep 1 08:05:30 CDT 2014
This will slice off the end of the output (And probably newlines)
but it's better than a stack overflow
---
programs/reg/reg.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/programs/reg/reg.c b/programs/reg/reg.c
index 1b46661..d299cbf 100644
--- a/programs/reg/reg.c
+++ b/programs/reg/reg.c
@@ -28,7 +28,7 @@ static int reg_printfW(const WCHAR *msg, ...)
WCHAR msg_buffer[8192];
va_start(va_args, msg);
- vsprintfW(msg_buffer, msg, va_args);
+ vsnprintfW(msg_buffer, 8192, msg, va_args);
va_end(va_args);
wlen = lstrlenW(msg_buffer);
--
2.1.0
More information about the wine-patches
mailing list