diff options
author | Andreas Schneider <asn@samba.org> | 2017-07-12 13:07:08 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2017-07-25 09:14:19 +0200 |
commit | a19b08c9c315279bc0afec09a0a409de168084b4 (patch) | |
tree | db9f44b94a37d4adcfe69667ef11a2be64d16a9f | |
parent | a841745166a54657e72247d2a20a04459e087084 (diff) | |
download | samba-a19b08c9c315279bc0afec09a0a409de168084b4.tar.gz |
s3:printing: Do not segfault in vlp if no command has been specified
We should just print the usage() and return
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
-rw-r--r-- | source3/printing/tests/vlp.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/source3/printing/tests/vlp.c b/source3/printing/tests/vlp.c index 86aba98380f..54a62f1c19d 100644 --- a/source3/printing/tests/vlp.c +++ b/source3/printing/tests/vlp.c @@ -405,6 +405,10 @@ int main(int argc, char **argv) chmod(printdb_path, 0666); /* Do commands */ + if (argc < 3) { + usage(); + return 1; + } if (strcmp(argv[2], "lpq") == 0) { return lpq_command(argc - 2, &argv[2]); |