diff options
author | Steve French <sfrench@samba.org> | 2006-03-10 03:47:57 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:11:13 -0500 |
commit | 84c398a72ee23c83c472f4ec99b19144d0a1f73e (patch) | |
tree | 04376a1a66424927b4fdfd1024c31488e1b18a4f /source3 | |
parent | dc93156fe96c1861f3ad072496ad223513e915e0 (diff) | |
download | samba-84c398a72ee23c83c472f4ec99b19144d0a1f73e.tar.gz samba-84c398a72ee23c83c472f4ec99b19144d0a1f73e.tar.bz2 samba-84c398a72ee23c83c472f4ec99b19144d0a1f73e.zip |
r14126: resolve two warnings from the coverity scan
(This used to be commit 32c7243b80f1f06d37511fb87f7a5c715f4847c6)
Diffstat (limited to 'source3')
-rwxr-xr-x | source3/client/mount.cifs.c | 13 |
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) |