[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wine-patches
Subject:    [1/2] msi: Fix buffer size calculation in get_keypath.
From:       Hans Leidekker <hans () codeweavers ! com>
Date:       2011-03-31 9:57:25
Message-ID: 1301565445.3335.1299.camel () t400
[Download RAW message or body]

---
 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;
-- 
1.7.1






[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic