Index: ntoskrnl/config/ntapi.c
===================================================================
--- ntoskrnl/config/ntapi.c	(revision 59931)
+++ ntoskrnl/config/ntapi.c	(working copy)
@@ -622,10 +622,12 @@
                                        NULL);
     if (!NT_SUCCESS(Status)) return Status;
 
-    /* Make sure the name is aligned, not too long, and the data under 4GB */
+    /* Make sure the name is aligned, not too long, the data under 2GB,
+         and the Data/DataSize parameters make sense */
     if ( (ValueNameCopy.Length > 32767) ||
          ((ValueNameCopy.Length & (sizeof(WCHAR) - 1))) ||
-         (DataSize > 0x80000000))
+         (DataSize > 0x80000000) ||
+         ((Data == NULL) && (DataSize > 0)))
     {
         /* Fail */
         ObDereferenceObject(KeyObject);
