[SCM] Samba Shared Repository - branch v3-4-test updated

Karolin Seeger kseeger at samba.org
Thu Oct 15 06:30:01 MDT 2009


The branch, v3-4-test has been updated
       via  106e3d5... Fix bug 6811 - pam_winbind references freed memory. s3: Fix reference to freed memory in pam_winbind.
      from  c685beb... s3: Fix bug 6606

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


- Log -----------------------------------------------------------------
commit 106e3d5bdb1683d53b5525e3fe2e9e2d9de27e2c
Author: Bo Yang <boyang at samba.org>
Date:   Wed Oct 14 12:45:16 2009 -0700

    Fix bug 6811 - pam_winbind references freed memory. s3: Fix reference to freed memory in pam_winbind.

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

Summary of changes:
 nsswitch/pam_winbind.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)


Changeset truncated at 500 lines:

diff --git a/nsswitch/pam_winbind.c b/nsswitch/pam_winbind.c
index 35cbc3b..132d637 100644
--- a/nsswitch/pam_winbind.c
+++ b/nsswitch/pam_winbind.c
@@ -976,7 +976,8 @@ static bool winbind_name_to_sid_string(struct pwb_context *ctx,
 				       char *sid_list_buffer,
 				       int sid_list_buffer_size)
 {
-	const char* sid_string;
+	const char* sid_string = NULL;
+	char *sid_str = NULL;
 
 	/* lookup name? */
 	if (IS_SID_STRING(name)) {
@@ -985,7 +986,6 @@ static bool winbind_name_to_sid_string(struct pwb_context *ctx,
 		wbcErr wbc_status;
 		struct wbcDomainSid sid;
 		enum wbcSidType type;
-		char *sid_str;
 
 		_pam_log_debug(ctx, LOG_DEBUG,
 			       "no sid given, looking up: %s\n", name);
@@ -1002,15 +1002,16 @@ static bool winbind_name_to_sid_string(struct pwb_context *ctx,
 			return false;
 		}
 
-		wbcFreeMemory(sid_str);
 		sid_string = sid_str;
 	}
 
 	if (!safe_append_string(sid_list_buffer, sid_string,
 				sid_list_buffer_size)) {
+		wbcFreeMemory(sid_str);
 		return false;
 	}
 
+	wbcFreeMemory(sid_str);
 	return true;
 }
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list