summaryrefslogtreecommitdiff
path: root/source3/client/mount.cifs.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/client/mount.cifs.c')
-rwxr-xr-xsource3/client/mount.cifs.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/source3/client/mount.cifs.c b/source3/client/mount.cifs.c
index 7801e7b222..103e369f27 100755
--- a/source3/client/mount.cifs.c
+++ b/source3/client/mount.cifs.c
@@ -863,7 +863,7 @@ int main(int argc, char ** argv)
char * share_name = NULL;
char * ipaddr = NULL;
char * uuid = NULL;
- char * mountpoint;
+ char * mountpoint = NULL;
char * options;
char * resolved_path;
char * temp;
@@ -897,9 +897,10 @@ int main(int argc, char ** argv)
/* #ifdef _GNU_SOURCE
printf(" node: %s machine: %s sysname %s domain %s\n", sysinfo.nodename,sysinfo.machine,sysinfo.sysname,sysinfo.domainname);
#endif */
-
- share_name = argv[1];
- mountpoint = argv[2];
+ if(argc > 2) {
+ share_name = argv[1];
+ mountpoint = argv[2];
+ }
/* add sharename in opts string as unc= parm */
@@ -1028,8 +1029,10 @@ int main(int argc, char ** argv)
}
}
- if(argc < 3)
+ if((argc < 3) || (share_name == NULL) || (mountpoint == NULL)) {
mount_cifs_usage();
+ exit(1);
+ }
if (getenv("PASSWD")) {
if(mountpassword == NULL)