[SCM] Samba Shared Repository - branch v3-2-test updated - initial-v3-2-test-1565-g9e71c89

Volker Lendecke vl at samba.org
Sun Jan 20 08:02:29 GMT 2008


The branch, v3-2-test has been updated
       via  9e71c89ac648040739ef2161a2e6c4299be1e35b (commit)
      from  7bb7a0def6518784befa75e5303289d2b4d36dd4 (commit)

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


- Log -----------------------------------------------------------------
commit 9e71c89ac648040739ef2161a2e6c4299be1e35b
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Jan 20 09:03:32 2008 +0100

    Fix a segfault
    
    Pointed out by Steven Danneman on irc, thanks!
    
    Jerry, Günther, please check!

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

Summary of changes:
 source/winbindd/winbindd_cm.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/winbindd/winbindd_cm.c b/source/winbindd/winbindd_cm.c
index 9082287..ef159f0 100644
--- a/source/winbindd/winbindd_cm.c
+++ b/source/winbindd/winbindd_cm.c
@@ -613,7 +613,13 @@ static bool get_dc_name_via_netlogon(struct winbindd_domain *domain,
 						     DS_RETURN_DNS_NAME,
 						     &domain_info);
 		if (W_ERROR_IS_OK(werr)) {
-			fstrcpy(tmp, domain_info->domain_controller_name);
+			tmp = talloc_strdup(
+				mem_ctx, domain_info->domain_controller_name);
+			if (tmp == NULL) {
+				DEBUG(0, ("talloc_strdup failed\n"));
+				talloc_destroy(mem_ctx);
+				return false;
+			}
 			if (strlen(domain->alt_name) == 0) {
 				fstrcpy(domain->alt_name,
 					domain_info->domain_name);
@@ -635,11 +641,10 @@ static bool get_dc_name_via_netlogon(struct winbindd_domain *domain,
 	/* And restore our original timeout. */
 	cli_set_timeout(netlogon_pipe->cli, orig_timeout);
 
-	talloc_destroy(mem_ctx);
-
 	if (!W_ERROR_IS_OK(werr)) {
 		DEBUG(10, ("rpccli_netlogon_getanydcname failed: %s\n",
 			   dos_errstr(werr)));
+		talloc_destroy(mem_ctx);
 		return False;
 	}
 
@@ -654,6 +659,8 @@ static bool get_dc_name_via_netlogon(struct winbindd_domain *domain,
 
 	fstrcpy(dcname, p);
 
+	talloc_destroy(mem_ctx);
+
 	DEBUG(10, ("rpccli_netlogon_getanydcname returned %s\n", dcname));
 
 	if (!resolve_name(dcname, dc_ss, 0x20)) {


-- 
Samba Shared Repository


More information about the samba-cvs mailing list