[PATCH 2/2] uninstaller: Allocate enough memory to null-terminate the command string

Hugh McMaster hugh.mcmaster at outlook.com
Mon May 15 03:02:42 CDT 2017


Signed-off-by: Hugh McMaster <hugh.mcmaster at outlook.com>
---
 programs/uninstaller/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/programs/uninstaller/main.c b/programs/uninstaller/main.c
index 1c834ea..d3c8943 100644
--- a/programs/uninstaller/main.c
+++ b/programs/uninstaller/main.c
@@ -245,7 +245,7 @@ static int FetchFromRootKey(HKEY root)
                 type == REG_DWORD && value == 1)
             {
                 static const WCHAR fmtW[] = {'m','s','i','e','x','e','c',' ','/','x','%','s',0};
-                command = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(fmtW) + lstrlenW(subKeyName)) * sizeof(WCHAR));
+                command = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(fmtW) + sizeOfSubKeyName + 1) * sizeof(WCHAR));
                 wsprintfW(command, fmtW, subKeyName);
             }
             else if (!RegQueryValueExW(hkeyApp, UninstallCommandlineW, NULL, NULL, NULL, &uninstlen))
-- 
2.7.4




More information about the wine-patches mailing list