Commit a971f548 authored by Francois Gouget's avatar Francois Gouget Committed by Alexandre Julliard

Don't use the data returned by RegQueryValueExW if it fails (found by

Valgrind). A spelling fix.
parent d1b344b1
...@@ -1240,6 +1240,8 @@ DWORD WINAPI SHQueryValueExW(HKEY hKey, LPCWSTR lpszValue, ...@@ -1240,6 +1240,8 @@ DWORD WINAPI SHQueryValueExW(HKEY hKey, LPCWSTR lpszValue,
if (pcbData) dwUnExpDataLen = *pcbData; if (pcbData) dwUnExpDataLen = *pcbData;
dwRet = RegQueryValueExW(hKey, lpszValue, lpReserved, &dwType, pvData, &dwUnExpDataLen); dwRet = RegQueryValueExW(hKey, lpszValue, lpReserved, &dwType, pvData, &dwUnExpDataLen);
if (dwRet!=ERROR_SUCCESS && dwRet!=ERROR_MORE_DATA)
return dwRet;
if (pcbData && (dwType == REG_EXPAND_SZ)) if (pcbData && (dwType == REG_EXPAND_SZ))
{ {
...@@ -1248,7 +1250,7 @@ DWORD WINAPI SHQueryValueExW(HKEY hKey, LPCWSTR lpszValue, ...@@ -1248,7 +1250,7 @@ DWORD WINAPI SHQueryValueExW(HKEY hKey, LPCWSTR lpszValue,
/* Expand type REG_EXPAND_SZ into REG_SZ */ /* Expand type REG_EXPAND_SZ into REG_SZ */
LPWSTR szData; LPWSTR szData;
/* If the caller didn't supply a buffer or the buffer is to small we have /* If the caller didn't supply a buffer or the buffer is too small we have
* to allocate our own * to allocate our own
*/ */
if ((!pvData) || (dwRet == ERROR_MORE_DATA) ) if ((!pvData) || (dwRet == ERROR_MORE_DATA) )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment