From 0bb6fdda903bb538f9c65d11634a48f9bb82c0c1 Mon Sep 17 00:00:00 2001 From: Rein Klazes Date: Fri, 5 Jul 2002 01:21:13 +0000 Subject: [PATCH] Check for NULL keyvalue in RegEnumKeyExA/W. --- dlls/advapi32/registry.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dlls/advapi32/registry.c b/dlls/advapi32/registry.c index 2d539b73267..afe8432c72b 100644 --- a/dlls/advapi32/registry.c +++ b/dlls/advapi32/registry.c @@ -297,6 +297,8 @@ DWORD WINAPI RegEnumKeyExW( HKEY hkey, DWORD index, LPWSTR name, LPDWORD name_le if (reserved) return ERROR_INVALID_PARAMETER; + if (!hkey) return ERROR_INVALID_HANDLE; + status = NtEnumerateKey( hkey, index, KeyNodeInformation, buffer, sizeof(buffer), &total_size ); @@ -358,6 +360,8 @@ DWORD WINAPI RegEnumKeyExA( HKEY hkey, DWORD index, LPSTR name, LPDWORD name_len if (reserved) return ERROR_INVALID_PARAMETER; + if (!hkey) return ERROR_INVALID_HANDLE; + status = NtEnumerateKey( hkey, index, KeyNodeInformation, buffer, sizeof(buffer), &total_size );