From 3d9fb73909c3bf2d2fec94e0724a741a20754241 Mon Sep 17 00:00:00 2001 From: Aric Stewart Date: Fri, 28 May 2004 19:28:41 +0000 Subject: [PATCH] Make sure that the size of the buffer passed to RegSetValueExW is in bytes not WCHARs. --- dlls/shell32/shellpath.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dlls/shell32/shellpath.c b/dlls/shell32/shellpath.c index c24f6fae7dc..bd273cd3d3a 100644 --- a/dlls/shell32/shellpath.c +++ b/dlls/shell32/shellpath.c @@ -1115,7 +1115,8 @@ HRESULT WINAPI SHGetFolderPathW( strcpyW(pszPath + 3, szDefaultPath); } dwType=REG_SZ; - RegSetValueExW(hKey,szValueName,0,REG_SZ,(LPBYTE)pszPath,strlenW(pszPath)+1); + RegSetValueExW(hKey,szValueName,0,REG_SZ,(LPBYTE)pszPath, + (strlenW(pszPath)+1)*sizeof(WCHAR)); } } RegCloseKey(hKey); @@ -1151,7 +1152,8 @@ HRESULT WINAPI SHGetFolderPathW( strcpyW(pszPath + 3, szDefaultPath); } dwType=REG_SZ; - RegSetValueExW(hKey,szValueName,0,REG_SZ,(LPBYTE)pszPath,strlenW(pszPath)+1); + RegSetValueExW(hKey,szValueName,0,REG_SZ,(LPBYTE)pszPath, + (strlenW(pszPath)+1)*sizeof(WCHAR)); } RegCloseKey(hKey); }