svn commit: samba r15755 - branches/SAMBA_3_0/source/libsmb trunk/source/libsmb

vlendec at samba.org vlendec at samba.org
Sat May 20 18:30:11 GMT 2006


Author: vlendec
Date: 2006-05-20 18:30:09 +0000 (Sat, 20 May 2006)
New Revision: 15755

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=15755

Log:
Fix Coverity bug # 294. Apparently password can be NULL, but cli_session_setup
derefences it.

Volker

Modified:
   branches/SAMBA_3_0/source/libsmb/cliconnect.c
   trunk/source/libsmb/cliconnect.c


Changeset:
Modified: branches/SAMBA_3_0/source/libsmb/cliconnect.c
===================================================================
--- branches/SAMBA_3_0/source/libsmb/cliconnect.c	2006-05-20 17:20:34 UTC (rev 15754)
+++ branches/SAMBA_3_0/source/libsmb/cliconnect.c	2006-05-20 18:30:09 UTC (rev 15755)
@@ -1495,6 +1495,10 @@
 	struct cli_state *cli = NULL;
 	int pw_len = password ? strlen(password)+1 : 0;
 
+	if (password == NULL) {
+		password = "";
+	}
+
 	nt_status = cli_start_connection(&cli, my_name, dest_host, 
 					 dest_ip, port, signing_state, flags, retry);
 	

Modified: trunk/source/libsmb/cliconnect.c
===================================================================
--- trunk/source/libsmb/cliconnect.c	2006-05-20 17:20:34 UTC (rev 15754)
+++ trunk/source/libsmb/cliconnect.c	2006-05-20 18:30:09 UTC (rev 15755)
@@ -1495,6 +1495,10 @@
 	struct cli_state *cli = NULL;
 	int pw_len = password ? strlen(password)+1 : 0;
 
+	if (password == NULL) {
+		password = "";
+	}
+
 	nt_status = cli_start_connection(&cli, my_name, dest_host, 
 					 dest_ip, port, signing_state, flags, retry);
 	



More information about the samba-cvs mailing list