From 7d470fdb1b180d63a4e08e7c9d0a88223031053f Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 31 Jul 2009 10:38:04 +0200 Subject: s4:auth: make sure we have elements returned at all in authsam_expand_nested_groups() metze --- source4/auth/sam.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source4') diff --git a/source4/auth/sam.c b/source4/auth/sam.c index b991090338..6285c31e5c 100644 --- a/source4/auth/sam.c +++ b/source4/auth/sam.c @@ -333,6 +333,12 @@ static NTSTATUS authsam_expand_nested_groups(struct ldb_context *sam_ctx, return NT_STATUS_INTERNAL_DB_CORRUPTION; } + if (res[0]->num_elements == 0) { + talloc_free(res); + talloc_free(tmp_ctx); + return NT_STATUS_OK; + } + for (i = 0; i < res[0]->elements[0].num_values; i++) { tmp_dn = ldb_dn_from_ldb_val(tmp_ctx, sam_ctx, &res[0]->elements[0].values[i]); -- cgit