[ros-diffs] [fireball] 14849: Fix (registry.c:325, dated 20050425) test failure. Description: Added RegOpenKeyA/W check for input param (if it's NULL pointer, returning error)

fireball at svn.reactos.com fireball at svn.reactos.com
Thu Apr 28 22:26:08 CEST 2005


Fix (registry.c:325, dated 20050425) test failure. Description: Added
RegOpenKeyA/W check for input param (if it's NULL pointer, returning
error)
Modified: trunk/reactos/lib/advapi32/reg/reg.c
  _____  

Modified: trunk/reactos/lib/advapi32/reg/reg.c
--- trunk/reactos/lib/advapi32/reg/reg.c	2005-04-28 20:00:37 UTC
(rev 14848)
+++ trunk/reactos/lib/advapi32/reg/reg.c	2005-04-28 20:26:06 UTC
(rev 14849)
@@ -1731,6 +1731,10 @@

   NTSTATUS Status;
 
   DPRINT("RegOpenKeyA hKey 0x%x lpSubKey %s phkResult %p\n", hKey,
lpSubKey, phkResult);
+
+  // Check input params
+  if (phkResult == NULL) return ERROR_INVALID_PARAMETER;
+
   Status = MapDefaultKey (&KeyHandle,
 			  hKey);
   if (!NT_SUCCESS(Status))
@@ -1782,6 +1786,10 @@
   NTSTATUS Status;
 
   DPRINT("RegOpenKeyW hKey 0x%x lpSubKey %S phkResult %p\n", hKey,
lpSubKey, phkResult);
+
+  // Check input params
+  if (phkResult == NULL) return ERROR_INVALID_PARAMETER;
+
   Status = MapDefaultKey (&KeyHandle,
 			  hKey);
   if (!NT_SUCCESS(Status))
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.reactos.org/pipermail/ros-diffs/attachments/20050428/7557d2fe/attachment.html


More information about the Ros-diffs mailing list