[SCM] Samba Shared Repository - branch master updated

Andreas Schneider asn at samba.org
Fri Jan 13 12:34:03 UTC 2017


The branch, master has been updated
       via  e1874bb winbind: Fix CID 1398534 Dereference before null check
      from  4d8cba6 ctdb-tests: Add takeover helper tests with banned/disconnected nodes

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit e1874bbf26eaa162cd6a5f11d96c564a983c9893
Author: Jeremy Allison <jra at samba.org>
Date:   Wed Jan 11 11:52:44 2017 -0800

    winbind: Fix CID 1398534 Dereference before null check
    
    Make all query_user_list backends consistent.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    
    Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
    Autobuild-Date(master): Fri Jan 13 13:33:37 CET 2017 on sn-devel-144

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

Summary of changes:
 source3/winbindd/winbindd_ads.c  | 8 ++++----
 source3/winbindd/winbindd_samr.c | 6 ++----
 2 files changed, 6 insertions(+), 8 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/winbindd/winbindd_ads.c b/source3/winbindd/winbindd_ads.c
index b14f21e..077c6ec 100644
--- a/source3/winbindd/winbindd_ads.c
+++ b/source3/winbindd/winbindd_ads.c
@@ -293,14 +293,12 @@ static NTSTATUS query_user_list(struct winbindd_domain *domain,
 	ADS_STRUCT *ads = NULL;
 	const char *attrs[] = { "sAMAccountType", "objectSid", NULL };
 	int count;
-	uint32_t *rids;
+	uint32_t *rids = NULL;
 	ADS_STATUS rc;
 	LDAPMessage *res = NULL;
 	LDAPMessage *msg = NULL;
 	NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
 
-	*prids = NULL;
-
 	DEBUG(3,("ads: query_user_list\n"));
 
 	if ( !winbindd_can_contact_domain( domain ) ) {
@@ -375,7 +373,9 @@ static NTSTATUS query_user_list(struct winbindd_domain *domain,
 	}
 
 	rids = talloc_realloc(mem_ctx, rids, uint32_t, count);
-	*prids = rids;
+	if (prids != NULL) {
+		*prids = rids;
+	}
 
 	status = NT_STATUS_OK;
 
diff --git a/source3/winbindd/winbindd_samr.c b/source3/winbindd/winbindd_samr.c
index 224f105..1a73fc4 100644
--- a/source3/winbindd/winbindd_samr.c
+++ b/source3/winbindd/winbindd_samr.c
@@ -169,15 +169,13 @@ static NTSTATUS sam_query_user_list(struct winbindd_domain *domain,
 {
 	struct rpc_pipe_client *samr_pipe = NULL;
 	struct policy_handle dom_pol = { 0 };
-	uint32_t *rids;
+	uint32_t *rids = NULL;
 	TALLOC_CTX *tmp_ctx;
 	NTSTATUS status, result;
 	struct dcerpc_binding_handle *b = NULL;
 
 	DEBUG(3,("samr_query_user_list\n"));
 
-	*prids = NULL;
-
 	tmp_ctx = talloc_stackframe();
 	if (tmp_ctx == NULL) {
 		return NT_STATUS_NO_MEMORY;
@@ -199,7 +197,7 @@ static NTSTATUS sam_query_user_list(struct winbindd_domain *domain,
 		goto done;
 	}
 
-	if (prids) {
+	if (prids != NULL) {
 		*prids = talloc_move(mem_ctx, &rids);
 	}
 


-- 
Samba Shared Repository



More information about the samba-cvs mailing list