summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2017-07-12 13:07:08 +0200
committerAndreas Schneider <asn@cryptomilk.org>2017-07-25 09:14:19 +0200
commita19b08c9c315279bc0afec09a0a409de168084b4 (patch)
treedb9f44b94a37d4adcfe69667ef11a2be64d16a9f
parenta841745166a54657e72247d2a20a04459e087084 (diff)
downloadsamba-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.c4
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]);