summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2010-08-17 13:44:42 +0200
committerAndreas Schneider <asn@samba.org>2010-08-17 13:48:05 +0200
commitfeb22e08972ab8a2ed6610b4d1ac1de361e6a500 (patch)
tree5c32efc1266982ff2425177d0325f2eed262e4b1 /source3
parent56f04188df598767901ab918e2be1f23a922c531 (diff)
downloadsamba-feb22e08972ab8a2ed6610b4d1ac1de361e6a500.tar.gz
samba-feb22e08972ab8a2ed6610b4d1ac1de361e6a500.tar.bz2
samba-feb22e08972ab8a2ed6610b4d1ac1de361e6a500.zip
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)!
Diffstat (limited to 'source3')
-rw-r--r--source3/rpc_server/srv_samr_nt.c6
1 files changed, 5 insertions, 1 deletions
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;