diff options
author | Michael Adam <obnox@samba.org> | 2007-08-31 15:34:26 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:30:27 -0500 |
commit | d4603ed3396ea6cd2d6a5e75f4b8faa84e3f2d22 (patch) | |
tree | a431637ad69319cdb5b8b19b2eadae1f71abd59e | |
parent | ac3f2e784f818fb06b20b053cf4127d331e8f63c (diff) | |
download | samba-d4603ed3396ea6cd2d6a5e75f4b8faa84e3f2d22.tar.gz samba-d4603ed3396ea6cd2d6a5e75f4b8faa84e3f2d22.tar.bz2 samba-d4603ed3396ea6cd2d6a5e75f4b8faa84e3f2d22.zip |
r24845: Fix a segfault in smbcontrol when called with parameters but no extra args.
Michael
(This used to be commit f1bbf9bc18fc615a5660674f8346b4a7bed50044)
-rw-r--r-- | source3/utils/smbcontrol.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/source3/utils/smbcontrol.c b/source3/utils/smbcontrol.c index 8255a41c96..a2c65e916c 100644 --- a/source3/utils/smbcontrol.c +++ b/source3/utils/smbcontrol.c @@ -1335,11 +1335,13 @@ int main(int argc, const char **argv) argv = (const char **)poptGetArgs(pc); argc = 0; - while (argv[argc] != NULL) { - argc++; + if (argv != NULL) { + while (argv[argc] != NULL) { + argc++; + } } - if (argc == 1) + if (argc <= 1) usage(pc); lp_load(dyn_CONFIGFILE,False,False,False,True); |