Commit 9171f0ca authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Introduction of '-' CLI prefix allowed empty commands to sneak through.

Fixes #2647
parent 9938f01f
varnishtest "empty cli command"
server s1 {
rxreq
txresp
} -start
varnish v1 -vcl+backend {} -start
varnish v1 -clierr 100 "-"
client c1 {
txreq
rxresp
} -run
......@@ -278,6 +278,12 @@ cls_exec(struct VCLS_fd *cfd, char * const *av)
break;
}
if (av[1] == NULL) {
VCLI_Out(cli, "Empty CLI command.\n");
VCLI_SetResult(cli, CLIS_SYNTAX);
break;
}
if (isupper(av[1][0])) {
VCLI_Out(cli, "all commands are in lower-case.\n");
VCLI_SetResult(cli, CLIS_UNKNOWN);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment