Sebastian Lackner : reg: Fix a heap corruption when printing specific REG_MULTI_SZ values.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Apr 25 09:47:12 CDT 2016


Module: wine
Branch: master
Commit: 7c774e98494d7392bc78bd3a8b2a2afd5ea0afe5
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=7c774e98494d7392bc78bd3a8b2a2afd5ea0afe5

Author: Sebastian Lackner <sebastian at fds-team.de>
Date:   Fri Apr 22 19:35:01 2016 +0200

reg: Fix a heap corruption when printing specific REG_MULTI_SZ values.

Signed-off-by: Sebastian Lackner <sebastian at fds-team.de>
Signed-off-by: Hugh McMaster <hugh.mcmaster at outlook.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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 6480f2c..32e75a0 100644
--- a/programs/reg/reg.c
+++ b/programs/reg/reg.c
@@ -587,7 +587,7 @@ static WCHAR *reg_data_to_wchar(DWORD type, const BYTE *src, DWORD size_bytes)
             }
 
             tmp_size = size_bytes - two_wchars; /* exclude both null terminators */
-            buffer = HeapAlloc(GetProcessHeap(), 0, tmp_size * 2);
+            buffer = HeapAlloc(GetProcessHeap(), 0, tmp_size * 2 + sizeof(WCHAR));
             len = tmp_size / sizeof(WCHAR);
 
             for (i = 0, destindex = 0; i < len; i++, destindex++)




More information about the wine-cvs mailing list