[REGEDIT] Early return FALSE in CreateNewKey() if pszKeyPath is NULL (#6840)

This fixes unhandled exception when trying to create a new key
in the root/"My computer". CORE-19567
This commit is contained in:
Maj Soklič 2024-05-06 22:46:55 +02:00 committed by GitHub
parent cadfdc554d
commit e79c896592
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -594,6 +594,8 @@ BOOL CreateNewKey(HWND hwndTV, HTREEITEM hItem)
HTREEITEM hNewItem;
pszKeyPath = GetItemPath(hwndTV, hItem, &hRootKey);
if (!pszKeyPath)
return bSuccess;
if (pszKeyPath[0] == L'\0')
hKey = hRootKey;
else if (RegOpenKeyW(hRootKey, pszKeyPath, &hKey) != ERROR_SUCCESS)