[NETAPI32]
authorEric Kohl <eric.kohl@reactos.org>
Mon, 9 May 2016 10:26:55 +0000 (10:26 +0000)
committerEric Kohl <eric.kohl@reactos.org>
Mon, 9 May 2016 10:26:55 +0000 (10:26 +0000)
Prevent dereferencing null-pointers.

svn path=/trunk/; revision=71299

reactos/dll/win32/netapi32/local_group.c
reactos/dll/win32/netapi32/user.c

index 4189611..1b00ea2 100644 (file)
@@ -1163,7 +1163,7 @@ NetLocalGroupEnum(
 //    }
 
 done:
 //    }
 
 done:
-    if (ApiStatus == NERR_Success && EnumContext->Phase != DonePhase)
+    if (ApiStatus == NERR_Success && EnumContext != NULL && EnumContext->Phase != DonePhase)
         ApiStatus = ERROR_MORE_DATA;
 
     if (EnumContext != NULL)
         ApiStatus = ERROR_MORE_DATA;
 
     if (EnumContext != NULL)
index 02fee92..6057772 100644 (file)
@@ -2554,7 +2554,7 @@ NetUserEnum(LPCWSTR servername,
 //    }
 
 done:
 //    }
 
 done:
-    if (ApiStatus == NERR_Success && EnumContext->Index < EnumContext->Count)
+    if (ApiStatus == NERR_Success && EnumContext != NULL && EnumContext->Index < EnumContext->Count)
         ApiStatus = ERROR_MORE_DATA;
 
     if (EnumContext != NULL)
         ApiStatus = ERROR_MORE_DATA;
 
     if (EnumContext != NULL)