samba-cvs.cvs
[Top] [All Lists]

[SCM] Samba Shared Repository - branch v3-2-test updated - release-3-2-0

Subject: [SCM] Samba Shared Repository - branch v3-2-test updated - release-3-2-0pre2-2383-gfb0a25d
From: Volker Lendecke
Date: Tue, 20 May 2008 10:29:40 -0500 CDT
The branch, v3-2-test has been updated
       via  fb0a25d59ddd28ea1d5af33ec7d9f817fac3fb9d (commit)
      from  f2993160a14ec286627af53b88d6fa535d8c9437 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-test


- Log -----------------------------------------------------------------
commit fb0a25d59ddd28ea1d5af33ec7d9f817fac3fb9d
Author: Volker Lendecke <vl@xxxxxxxxx>
Date:   Tue May 20 17:29:40 2008 +0200

    Fix a valgrind error in _samr_LookupNames

-----------------------------------------------------------------------

Summary of changes:
 source/rpc_server/srv_samr_nt.c |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/rpc_server/srv_samr_nt.c b/source/rpc_server/srv_samr_nt.c
index f28c771..42431bd 100644
--- a/source/rpc_server/srv_samr_nt.c
+++ b/source/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)));
 


-- 
Samba Shared Repository

<Prev in Thread] Current Thread [Next in Thread>
  • [SCM] Samba Shared Repository - branch v3-2-test updated - release-3-2-0pre2-2383-gfb0a25d, Volker Lendecke <=