From 0aaf17c0d8c35de836540f83b573e1329b991e09 Mon Sep 17 00:00:00 2001 From: Hans Leidekker Date: Thu, 31 Mar 2011 11:57:25 +0200 Subject: [PATCH] msi: Fix buffer size calculation in get_keypath. --- dlls/msi/action.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/dlls/msi/action.c b/dlls/msi/action.c index a5a1e336955..73d6d1bdb74 100644 --- a/dlls/msi/action.c +++ b/dlls/msi/action.c @@ -2879,14 +2879,11 @@ static WCHAR *get_keypath( MSIPACKAGE *package, HKEY root, const WCHAR *path ) UINT size; WCHAR *path_32node; - size = (strlenW( path ) + strlenW( szWow6432Node ) + 1) * sizeof(WCHAR); - path_32node = msi_alloc( size ); - if (!path_32node) - return NULL; + size = (strlenW( path ) + strlenW( szWow6432Node ) + 2) * sizeof(WCHAR); + if (!(path_32node = msi_alloc( size ))) return NULL; memcpy( path_32node, path, len * sizeof(WCHAR) ); - path_32node[len] = 0; - strcatW( path_32node, szWow6432Node ); + strcpyW( path_32node + len, szWow6432Node ); strcatW( path_32node, szBackSlash ); strcatW( path_32node, path + len ); return path_32node;