svn commit: samba r14126 - in branches/SAMBA_3_0/source/client: .

sfrench at samba.org sfrench at samba.org
Fri Mar 10 03:47:58 GMT 2006


Author: sfrench
Date: 2006-03-10 03:47:57 +0000 (Fri, 10 Mar 2006)
New Revision: 14126

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

Log:
resolve two warnings from the coverity scan

Modified:
   branches/SAMBA_3_0/source/client/mount.cifs.c


Changeset:
Modified: branches/SAMBA_3_0/source/client/mount.cifs.c
===================================================================
--- branches/SAMBA_3_0/source/client/mount.cifs.c	2006-03-09 23:54:50 UTC (rev 14125)
+++ branches/SAMBA_3_0/source/client/mount.cifs.c	2006-03-10 03:47:57 UTC (rev 14126)
@@ -863,7 +863,7 @@
 	char * share_name = NULL;
 	char * ipaddr = NULL;
 	char * uuid = NULL;
-	char * mountpoint;
+	char * mountpoint = NULL;
 	char * options;
 	char * resolved_path;
 	char * temp;
@@ -897,10 +897,11 @@
 /* #ifdef _GNU_SOURCE
 	printf(" node: %s machine: %s sysname %s domain %s\n", sysinfo.nodename,sysinfo.machine,sysinfo.sysname,sysinfo.domainname);
 #endif */
+	if(argc > 2) {
+		share_name = argv[1];
+		mountpoint = argv[2];
+	}
 
-	share_name = argv[1];
-	mountpoint = argv[2];
-
 	/* add sharename in opts string as unc= parm */
 
 	while ((c = getopt_long (argc, argv, "afFhilL:no:O:rsSU:vVwt:",
@@ -1028,8 +1029,10 @@
 		}
 	}
 
-	if(argc < 3)
+	if((argc < 3) || (share_name == NULL) || (mountpoint == NULL)) {
 		mount_cifs_usage();
+		exit(1);
+	}
 
 	if (getenv("PASSWD")) {
 		if(mountpassword == NULL)



More information about the samba-cvs mailing list