diff --git a/src/t_stream.c b/src/t_stream.c index f3cfeb0b2..68836bf15 100644 --- a/src/t_stream.c +++ b/src/t_stream.c @@ -3459,6 +3459,11 @@ void xinfoCommand(client *c) { /* HELP is special. Handle it ASAP. */ if (!strcasecmp(c->argv[1]->ptr,"HELP")) { + if (c->argc != 2) { + addReplySubcommandSyntaxError(c); + return; + } + const char *help[] = { "CONSUMERS ", " Show consumers of .", diff --git a/tests/unit/type/stream.tcl b/tests/unit/type/stream.tcl index 5ae2b2a3e..98cdbacef 100644 --- a/tests/unit/type/stream.tcl +++ b/tests/unit/type/stream.tcl @@ -714,4 +714,9 @@ start_server {tags {"stream"}} { catch {r XGROUP help xxx} e assert_match "*Unknown subcommand or wrong number of arguments*" $e } + + test {XINFO HELP should not have unexpected options} { + catch {r XINFO help xxx} e + assert_match "*Unknown subcommand or wrong number of arguments*" $e + } }