[SCM] Samba Shared Repository - branch master updated

Jeremy Allison jra at samba.org
Fri Jan 15 18:34:13 MST 2010


The branch, master has been updated
       via  f85b6ee... Second part of bug 7045 - Bad (non memory copying) interfaces in smbc_setXXXX calls.
      from  2d41b1a... Fix bug 7045 - Bad (non memory copying) interfaces in smbc_setXXXX calls.

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


- Log -----------------------------------------------------------------
commit f85b6ee90b88c7f7b2a92c8a5f3e2ebe59c1087b
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Jan 15 17:33:24 2010 -0800

    Second part of bug 7045 - Bad (non memory copying) interfaces in smbc_setXXXX calls.
    
    Protect against SMB_STRDUP of null...
    
    Jeremy.

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

Summary of changes:
 source3/libsmb/libsmb_setget.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/libsmb/libsmb_setget.c b/source3/libsmb/libsmb_setget.c
index 3ef7078..791b4cd 100644
--- a/source3/libsmb/libsmb_setget.c
+++ b/source3/libsmb/libsmb_setget.c
@@ -40,7 +40,9 @@ void
 smbc_setNetbiosName(SMBCCTX *c, char * netbios_name)
 {
 	SAFE_FREE(c->netbios_name);
-	c->netbios_name = SMB_STRDUP(netbios_name);
+	if (netbios_name) {
+		c->netbios_name = SMB_STRDUP(netbios_name);
+	}
 }
 
 /** Get the workgroup used for making connections */
@@ -55,7 +57,9 @@ void
 smbc_setWorkgroup(SMBCCTX *c, char * workgroup)
 {
 	SAFE_FREE(c->workgroup);
-	c->workgroup = SMB_STRDUP(workgroup);
+	if (workgroup) {
+		c->workgroup = SMB_STRDUP(workgroup);
+	}
 }
 
 /** Get the username used for making connections */
@@ -70,7 +74,9 @@ void
 smbc_setUser(SMBCCTX *c, char * user)
 {
 	SAFE_FREE(c->user);
-	c->user = SMB_STRDUP(user);
+	if (user) {
+		c->user = SMB_STRDUP(user);
+	}
 }
 
 /** Get the debug level */


-- 
Samba Shared Repository


More information about the samba-cvs mailing list