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)
committerVolker Lendecke <vl@samba.org>
Tue, 15 Dec 2009 19:28:47 +0000 (20:28 +0100)
source3/rpc_server/srv_samr_nt.c

index 2bfd6c3a8990a6ef52a42b6732395b1ad8261c41..6b40385744694bb997282c44403c7edd312e7d43 100644 (file)
@@ -5361,6 +5361,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;
 }