From: Michael Schuster Date: Tue, 9 Jun 2020 14:17:04 +0000 (+0200) Subject: Fix nullptr regression in RegistryUtil::ReadRegistry X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~222^2^2~167 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=2b680cadd3765991f08b439f8ab7effefb1defb6;p=nextcloud-desktop.git Fix nullptr regression in RegistryUtil::ReadRegistry Merging PR #2057 caused the Windows build to fail: shell_integration\windows\OCUtil\RegistryUtil.cpp(43): error C2664: 'LSTATUS RegOpenKeyExW(HKEY,LPCWSTR,DWORD,REGSAM,PHKEY)': cannot convert argument 3 from 'nullptr' to 'DWORD' The previous implementation prior the PR supplied NULL as the argument 3 to RegOpenKeyEx, so it was silently accepted and translated to zero, satisfying the DWORD's type requirement. Signed-off-by: Michael Schuster --- diff --git a/shell_integration/windows/OCUtil/RegistryUtil.cpp b/shell_integration/windows/OCUtil/RegistryUtil.cpp index fc8b125dc..29a8c8903 100644 --- a/shell_integration/windows/OCUtil/RegistryUtil.cpp +++ b/shell_integration/windows/OCUtil/RegistryUtil.cpp @@ -40,7 +40,7 @@ bool RegistryUtil::ReadRegistry(const wchar_t* key, const wchar_t* name, wstring HKEY rootKey = nullptr; - hResult = HRESULT_FROM_WIN32(RegOpenKeyEx(HKEY_CURRENT_USER, (LPCWSTR)key, nullptr, KEY_READ, &rootKey)); + hResult = HRESULT_FROM_WIN32(RegOpenKeyEx(HKEY_CURRENT_USER, (LPCWSTR)key, 0, KEY_READ, &rootKey)); if(!SUCCEEDED(hResult)) {