Module: wine Branch: master Commit: 7c774e98494d7392bc78bd3a8b2a2afd5ea0afe5 URL: http://source.winehq.org/git/wine.git/?a=commit;h=7c774e98494d7392bc78bd3a8b...
Author: Sebastian Lackner sebastian@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@fds-team.de Signed-off-by: Hugh McMaster hugh.mcmaster@outlook.com Signed-off-by: Alexandre Julliard julliard@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++)