s3: Fix _samr_GetAliasMembership for results with 0 rids
authorVolker Lendecke <vl@samba.org>
Tue, 15 Dec 2009 13:01:43 +0000 (14:01 +0100)
committerKarolin Seeger <kseeger@samba.org>
Mon, 21 Dec 2009 09:55:02 +0000 (10:55 +0100)
(cherry picked from commit 526ceefc9d2df46b5b172a15d196f1f1de6ff6c7)

source3/rpc_server/srv_samr_nt.c

index f3a48a8d8fe514acb400366149657748fe6062d9..d50c6c3e0e6316b3422eb1206e169753fa122c41 100644 (file)
@@ -5360,6 +5360,14 @@ NTSTATUS _samr_GetAliasMembership(pipes_struct *p,
        r->out.rids->count = num_alias_rids;
        r->out.rids->ids = alias_rids;
 
+       if (r->out.rids->ids == NULL) {
+               /* Windows domain clients don't accept a NULL ptr here */
+               r->out.rids->ids = talloc_zero(p->mem_ctx, uint32_t);
+       }
+       if (r->out.rids->ids == NULL) {
+               return NT_STATUS_NO_MEMORY;
+       }
+
        return NT_STATUS_OK;
 }