diff --git a/reactos/dll/win32/advapi32/reg/reg.c b/reactos/dll/win32/advapi32/reg/reg.c index c1feb0f62d1..337ddbe1790 100644 --- a/reactos/dll/win32/advapi32/reg/reg.c +++ b/reactos/dll/win32/advapi32/reg/reg.c @@ -1180,6 +1180,13 @@ RegDeleteKeyA (HKEY hKey, HANDLE TargetKey; NTSTATUS Status; + /* Make sure we got a subkey */ + if (!lpSubKey) + { + /* Fail */ + return ERROR_INVALID_PARAMETER; + } + Status = MapDefaultKey (&ParentKey, hKey); if (!NT_SUCCESS(Status)) @@ -1234,6 +1241,13 @@ RegDeleteKeyW (HKEY hKey, HANDLE TargetKey; NTSTATUS Status; + /* Make sure we got a subkey */ + if (!lpSubKey) + { + /* Fail */ + return ERROR_INVALID_PARAMETER; + } + Status = MapDefaultKey (&ParentKey, hKey); if (!NT_SUCCESS(Status))