The branch, v3-3-test has been updated
       via  1444db8be1de00a3e9c805f1accd8f1f4670d729 (commit)
      from  fa443081eaff77623653ed0390c4f9dabc4487b5 (commit)

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


- Log -----------------------------------------------------------------
commit 1444db8be1de00a3e9c805f1accd8f1f4670d729
Author: Volker Lendecke <[EMAIL PROTECTED]>
Date:   Tue May 6 13:53:45 2008 +0200

    Fix a panic in the [ug]id2sid valgrind bug fix
    
    Always, always run "make test" before pushing stuff :-)

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

Summary of changes:
 source/passdb/lookup_sid.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/passdb/lookup_sid.c b/source/passdb/lookup_sid.c
index debd67b..a7175b9 100644
--- a/source/passdb/lookup_sid.c
+++ b/source/passdb/lookup_sid.c
@@ -1012,8 +1012,9 @@ static bool fetch_sid_from_uid_cache(DOM_SID *psid, uid_t 
uid)
                return false;
        }
 
-       SMB_ASSERT(cache_value.length == sizeof(*psid));
-       memcpy(psid, cache_value.data, sizeof(*psid));
+       memcpy(psid, cache_value.data, MIN(sizeof(*psid), cache_value.length));
+       SMB_ASSERT(cache_value.length >= offsetof(struct dom_sid, id_auth));
+       SMB_ASSERT(cache_value.length == ndr_size_dom_sid(psid, 0));
 
        return true;
 }
@@ -1066,8 +1067,9 @@ static bool fetch_sid_from_gid_cache(DOM_SID *psid, gid_t 
gid)
                return false;
        }
 
-       SMB_ASSERT(cache_value.length == sizeof(*psid));
-       memcpy(psid, cache_value.data, sizeof(*psid));
+       memcpy(psid, cache_value.data, MIN(sizeof(*psid), cache_value.length));
+       SMB_ASSERT(cache_value.length >= offsetof(struct dom_sid, id_auth));
+       SMB_ASSERT(cache_value.length == ndr_size_dom_sid(psid, 0));
 
        return true;
 }


-- 
Samba Shared Repository

Reply via email to