[SCM] Samba Shared Repository - branch master updated

Volker Lendecke vlendec at samba.org
Thu Apr 19 14:29:03 MDT 2012


The branch, master has been updated
       via  393936a s3: Fix Coverity ID 2682 -- NULL_RETURNS
       via  3f18316 s3: Fix Coverity ID 2727 to 2740 -- UNINIT
       via  e573f11 s3: Fix Coverity ID 2686 -- RESOURCE_LEAK
      from  4ded55e s4-python: Ensure we handle the no-eadb case for system xattrs in get/setntacl

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


- Log -----------------------------------------------------------------
commit 393936aee6f20d85ba2b3e6c59af7c6b8c554a28
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Apr 19 16:09:41 2012 +0200

    s3: Fix Coverity ID 2682 -- NULL_RETURNS
    
    Autobuild-User: Volker Lendecke <vl at samba.org>
    Autobuild-Date: Thu Apr 19 22:28:34 CEST 2012 on sn-devel-104

commit 3f18316358c15fc13ca676b497c7f510b1d5bd85
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Apr 19 15:38:25 2012 +0200

    s3: Fix Coverity ID 2727 to 2740 -- UNINIT

commit e573f114681533425eded76f1322a9327308c40e
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Apr 19 15:30:06 2012 +0200

    s3: Fix Coverity ID 2686 -- RESOURCE_LEAK

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

Summary of changes:
 source3/locking/posix.c          |   13 ++++++++++---
 source3/nmbd/nmbd_processlogon.c |    1 +
 source3/utils/net_rpc_printer.c  |   19 ++++++++++++-------
 source3/winbindd/winbindd_pam.c  |    4 ++--
 4 files changed, 25 insertions(+), 12 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/locking/posix.c b/source3/locking/posix.c
index 463aa21..557099b 100644
--- a/source3/locking/posix.c
+++ b/source3/locking/posix.c
@@ -457,11 +457,18 @@ void reduce_windows_lock_ref_count(files_struct *fsp, unsigned int dcount)
 		posix_pending_close_db, talloc_tos(),
 		locking_ref_count_key_fsp(fsp, &tmp));
 
+	if (rec == NULL) {
+		DEBUG(0, ("reduce_windows_lock_ref_count: rec not found\n"));
+		return;
+	}
+
 	value = dbwrap_record_get_value(rec);
 
-	SMB_ASSERT((rec != NULL)
-		   && (value.dptr != NULL)
-		   && (value.dsize == sizeof(lock_ref_count)));
+	if ((value.dptr == NULL) ||  (value.dsize != sizeof(lock_ref_count))) {
+		DEBUG(0, ("reduce_windows_lock_ref_count: wrong value\n"));
+		TALLOC_FREE(rec);
+		return;
+	}
 
 	memcpy(&lock_ref_count, value.dptr, sizeof(lock_ref_count));
 
diff --git a/source3/nmbd/nmbd_processlogon.c b/source3/nmbd/nmbd_processlogon.c
index 76864e6..ca77ebf 100644
--- a/source3/nmbd/nmbd_processlogon.c
+++ b/source3/nmbd/nmbd_processlogon.c
@@ -505,6 +505,7 @@ logons are not enabled.\n", inet_ntoa(p->ip) ));
 		status = push_nbt_netlogon_response(&blob_out, talloc_tos(), &response);
 		if (!NT_STATUS_IS_OK(status)) {
 			DEBUG(0,("process_logon_packet: failed to push packet\n"));
+			SAFE_FREE(source_addr);
 			return;
 		}
 
diff --git a/source3/utils/net_rpc_printer.c b/source3/utils/net_rpc_printer.c
index eec5a6c..ef84d9e 100644
--- a/source3/utils/net_rpc_printer.c
+++ b/source3/utils/net_rpc_printer.c
@@ -1309,7 +1309,7 @@ static NTSTATUS rpc_printer_publish_internals_args(struct rpc_pipe_client *pipe_
 	struct spoolss_SetPrinterInfoCtr info_ctr;
 	struct spoolss_DevmodeContainer devmode_ctr;
 	struct sec_desc_buf secdesc_ctr;
-	struct policy_handle hnd;
+	struct policy_handle hnd = { 0, };
 	WERROR result;
 	const char *action_str;
 
@@ -1465,7 +1465,7 @@ NTSTATUS rpc_printer_publish_list_internals(struct net_context *c,
 	const char *printername, *sharename;
 	union spoolss_PrinterInfo *info_enum;
 	union spoolss_PrinterInfo info;
-	struct policy_handle hnd;
+	struct policy_handle hnd = { 0, };
 	int state;
 	WERROR werr;
 
@@ -1564,7 +1564,8 @@ NTSTATUS rpc_printer_migrate_security_internals(struct net_context *c,
 	const char *printername, *sharename;
 	struct rpc_pipe_client *pipe_hnd_dst = NULL;
 	struct dcerpc_binding_handle *b_dst = NULL;
-	struct policy_handle hnd_src, hnd_dst;
+	struct policy_handle hnd_src = { 0, };
+	struct policy_handle hnd_dst = { 0, };
 	union spoolss_PrinterInfo *info_enum;
 	struct cli_state *cli_dst = NULL;
 	union spoolss_PrinterInfo info_src, info_dst;
@@ -1714,7 +1715,8 @@ NTSTATUS rpc_printer_migrate_forms_internals(struct net_context *c,
 	const char *printername, *sharename;
 	struct rpc_pipe_client *pipe_hnd_dst = NULL;
 	struct dcerpc_binding_handle *b_dst = NULL;
-	struct policy_handle hnd_src, hnd_dst;
+	struct policy_handle hnd_src = { 0, };
+	struct policy_handle hnd_dst = { 0, };
 	union spoolss_PrinterInfo *info_enum;
 	union spoolss_PrinterInfo info_dst;
 	uint32_t num_forms;
@@ -1889,7 +1891,8 @@ NTSTATUS rpc_printer_migrate_drivers_internals(struct net_context *c,
 	bool got_dst_driver_share = false;
 	struct rpc_pipe_client *pipe_hnd_dst = NULL;
 	struct dcerpc_binding_handle *b_dst = NULL;
-	struct policy_handle hnd_src, hnd_dst;
+	struct policy_handle hnd_src = { 0, };
+	struct policy_handle hnd_dst = { 0, };
 	union spoolss_DriverInfo drv_info_src;
 	union spoolss_PrinterInfo *info_enum;
 	union spoolss_PrinterInfo info_dst;
@@ -2110,7 +2113,8 @@ NTSTATUS rpc_printer_migrate_printers_internals(struct net_context *c,
 	union spoolss_PrinterInfo info_dst, info_src;
 	union spoolss_PrinterInfo *info_enum;
 	struct cli_state *cli_dst = NULL;
-	struct policy_handle hnd_dst, hnd_src;
+	struct policy_handle hnd_src = { 0, };
+	struct policy_handle hnd_dst = { 0, };
 	const char *printername, *sharename;
 	struct rpc_pipe_client *pipe_hnd_dst = NULL;
 	struct dcerpc_binding_handle *b_dst = NULL;
@@ -2279,7 +2283,8 @@ NTSTATUS rpc_printer_migrate_settings_internals(struct net_context *c,
 	const char *printername, *sharename;
 	struct rpc_pipe_client *pipe_hnd_dst = NULL;
 	struct dcerpc_binding_handle *b_dst = NULL;
-	struct policy_handle hnd_src, hnd_dst;
+	struct policy_handle hnd_src = { 0, };
+	struct policy_handle hnd_dst = { 0, };
 	union spoolss_PrinterInfo *info_enum;
 	union spoolss_PrinterInfo info_dst_publish;
 	union spoolss_PrinterInfo info_dst;
diff --git a/source3/winbindd/winbindd_pam.c b/source3/winbindd/winbindd_pam.c
index 6757f36..216e1ff 100644
--- a/source3/winbindd/winbindd_pam.c
+++ b/source3/winbindd/winbindd_pam.c
@@ -2213,8 +2213,8 @@ enum winbindd_result winbindd_dual_pam_chng_pswd_auth_crap(struct winbindd_domai
 			state->request->data.chng_pswd_auth_crap.old_lm_hash_enc,
 			state->request->data.chng_pswd_auth_crap.old_lm_hash_enc_len);
 	} else {
-		new_lm_password.length = 0;
-		old_lm_hash_enc.length = 0;
+		new_lm_password = data_blob_null;
+		old_lm_hash_enc = data_blob_null;
 	}
 
 	/* Get sam handle */


-- 
Samba Shared Repository


More information about the samba-cvs mailing list