msi: Fix buffer size calculation in get_keypath.
This commit is contained in:
parent
e5fe510720
commit
0aaf17c0d8
|
@ -2879,14 +2879,11 @@ static WCHAR *get_keypath( MSIPACKAGE *package, HKEY root, const WCHAR *path )
|
||||||
UINT size;
|
UINT size;
|
||||||
WCHAR *path_32node;
|
WCHAR *path_32node;
|
||||||
|
|
||||||
size = (strlenW( path ) + strlenW( szWow6432Node ) + 1) * sizeof(WCHAR);
|
size = (strlenW( path ) + strlenW( szWow6432Node ) + 2) * sizeof(WCHAR);
|
||||||
path_32node = msi_alloc( size );
|
if (!(path_32node = msi_alloc( size ))) return NULL;
|
||||||
if (!path_32node)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
memcpy( path_32node, path, len * sizeof(WCHAR) );
|
memcpy( path_32node, path, len * sizeof(WCHAR) );
|
||||||
path_32node[len] = 0;
|
strcpyW( path_32node + len, szWow6432Node );
|
||||||
strcatW( path_32node, szWow6432Node );
|
|
||||||
strcatW( path_32node, szBackSlash );
|
strcatW( path_32node, szBackSlash );
|
||||||
strcatW( path_32node, path + len );
|
strcatW( path_32node, path + len );
|
||||||
return path_32node;
|
return path_32node;
|
||||||
|
|
Loading…
Reference in New Issue