From feb22e08972ab8a2ed6610b4d1ac1de361e6a500 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Tue, 17 Aug 2010 13:44:42 +0200 Subject: s3-samr: Correctly fix the transition from enum to uint32_t. What type an enum is depends on the implementation, the compiler and probably the compiler options. sizeof(enum) is normally not sizeof(int)! --- source3/rpc_server/srv_samr_nt.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'source3') diff --git a/source3/rpc_server/srv_samr_nt.c b/source3/rpc_server/srv_samr_nt.c index a19be4ed7f..127a0cbbff 100644 --- a/source3/rpc_server/srv_samr_nt.c +++ b/source3/rpc_server/srv_samr_nt.c @@ -1795,7 +1795,11 @@ NTSTATUS _samr_LookupNames(struct pipes_struct *p, rids.ids = rid; types.count = num_rids; - types.ids = (uint32_t *) type; + types.ids = talloc_array(p->mem_ctx, uint32_t, num_rids); + NT_STATUS_HAVE_NO_MEMORY(type); + for (i = 0; i < num_rids; i++) { + types.ids[i] = (type[i] & 0xffffffff); + } *r->out.rids = rids; *r->out.types = types; -- cgit