Hans Leidekker : msi: Fix buffer size calculation in get_keypath.

Alexandre Julliard julliard at winehq.org
Thu Mar 31 12:43:44 CDT 2011


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

Author: Hans Leidekker <hans at codeweavers.com>
Date:   Thu Mar 31 11:57:25 2011 +0200

msi: Fix buffer size calculation in get_keypath.

---

 dlls/msi/action.c |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/dlls/msi/action.c b/dlls/msi/action.c
index a5a1e33..73d6d1b 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;




More information about the wine-cvs mailing list