summaryrefslogtreecommitdiff
path: root/source3/rpc_server
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2008-05-20 17:29:40 +0200
committerGünther Deschner <gd@samba.org>2008-05-20 17:51:38 +0200
commit6a286a7bf4375038ad4dffe0a436a1a743f6aad6 (patch)
tree5f4f90dbabfa02a5401eb99e9a233e633fcb1555 /source3/rpc_server
parent0210f7af917d0e4ea1f16f9c6e767b8fe817c095 (diff)
downloadsamba-6a286a7bf4375038ad4dffe0a436a1a743f6aad6.tar.gz
samba-6a286a7bf4375038ad4dffe0a436a1a743f6aad6.tar.bz2
samba-6a286a7bf4375038ad4dffe0a436a1a743f6aad6.zip
Fix a valgrind error in _samr_LookupNames
(cherry picked from commit fb0a25d59ddd28ea1d5af33ec7d9f817fac3fb9d) (This used to be commit 89f87efa2394e99802ca23307e712fc5820a5fc6)
Diffstat (limited to 'source3/rpc_server')
-rw-r--r--source3/rpc_server/srv_samr_nt.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/source3/rpc_server/srv_samr_nt.c b/source3/rpc_server/srv_samr_nt.c
index f28c771d3e..42431bd482 100644
--- a/source3/rpc_server/srv_samr_nt.c
+++ b/source3/rpc_server/srv_samr_nt.c
@@ -1786,8 +1786,8 @@ NTSTATUS _samr_LookupNames(pipes_struct *p,
struct samr_LookupNames *r)
{
NTSTATUS status;
- uint32 rid[MAX_SAM_ENTRIES];
- enum lsa_SidType type[MAX_SAM_ENTRIES];
+ uint32 *rid;
+ enum lsa_SidType *type;
int i;
int num_rids = r->in.num_names;
DOM_SID pol_sid;
@@ -1796,9 +1796,6 @@ NTSTATUS _samr_LookupNames(pipes_struct *p,
DEBUG(5,("_samr_LookupNames: %d\n", __LINE__));
- ZERO_ARRAY(rid);
- ZERO_ARRAY(type);
-
if (!get_lsa_policy_samr_sid(p, r->in.domain_handle, &pol_sid, &acc_granted, NULL)) {
return NT_STATUS_OBJECT_TYPE_MISMATCH;
}
@@ -1815,6 +1812,12 @@ NTSTATUS _samr_LookupNames(pipes_struct *p,
DEBUG(5,("_samr_LookupNames: truncating entries to %d\n", num_rids));
}
+ rid = talloc_array(p->mem_ctx, uint32, num_rids);
+ NT_STATUS_HAVE_NO_MEMORY(rid);
+
+ type = talloc_array(p->mem_ctx, enum lsa_SidType, num_rids);
+ NT_STATUS_HAVE_NO_MEMORY(rid);
+
DEBUG(5,("_samr_LookupNames: looking name on SID %s\n",
sid_string_dbg(&pol_sid)));