From 84c398a72ee23c83c472f4ec99b19144d0a1f73e Mon Sep 17 00:00:00 2001 From: Steve French Date: Fri, 10 Mar 2006 03:47:57 +0000 Subject: r14126: resolve two warnings from the coverity scan (This used to be commit 32c7243b80f1f06d37511fb87f7a5c715f4847c6) --- source3/client/mount.cifs.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'source3/client/mount.cifs.c') 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) -- cgit