summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/auth/auth_util.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/source4/auth/auth_util.c b/source4/auth/auth_util.c
index 2b9b0c25c2..be7992ae82 100644
--- a/source4/auth/auth_util.c
+++ b/source4/auth/auth_util.c
@@ -367,11 +367,13 @@ NTSTATUS make_server_info_netlogon_validation(TALLOC_CTX *mem_ctx,
size_t sidcount = server_info->n_domain_groups + validation->sam3->sidcount;
size_t n_dgrps = server_info->n_domain_groups;
- dgrps = talloc_realloc(server_info, dgrps, struct dom_sid*, sidcount);
- NT_STATUS_HAVE_NO_MEMORY(dgrps);
+ if (validation->sam3->sidcount > 0) {
+ dgrps = talloc_realloc(server_info, dgrps, struct dom_sid*, sidcount);
+ NT_STATUS_HAVE_NO_MEMORY(dgrps);
- for (i = 0; i < validation->sam3->sidcount; i++) {
- dgrps[n_dgrps + i] = talloc_reference(dgrps, validation->sam3->sids[i].sid);
+ for (i = 0; i < validation->sam3->sidcount; i++) {
+ dgrps[n_dgrps + i] = talloc_reference(dgrps, validation->sam3->sids[i].sid);
+ }
}
server_info->n_domain_groups = sidcount;