diff --git a/src/acl.c b/src/acl.c index 6dd0f70ac..3ce45f03b 100644 --- a/src/acl.c +++ b/src/acl.c @@ -1911,7 +1911,7 @@ void aclCommand(client *c) { addReplyBulkCString(c,"client-info"); addReplyBulkCBuffer(c,le->cinfo,sdslen(le->cinfo)); } - } else if (!strcasecmp(sub,"help")) { + } else if (c->argc == 2 && !strcasecmp(sub,"help")) { const char *help[] = { "LOAD -- Reload users from the ACL file.", "SAVE -- Save the current config to the ACL file.", diff --git a/src/latency.c b/src/latency.c index 9a291ac9b..dfdc6668c 100644 --- a/src/latency.c +++ b/src/latency.c @@ -621,7 +621,7 @@ NULL resets += latencyResetEvent(c->argv[j]->ptr); addReplyLongLong(c,resets); } - } else if (!strcasecmp(c->argv[1]->ptr,"help") && c->argc >= 2) { + } else if (!strcasecmp(c->argv[1]->ptr,"help") && c->argc == 2) { addReplyHelp(c, help); } else { addReplySubcommandSyntaxError(c); diff --git a/src/t_stream.c b/src/t_stream.c index 676ddd9bb..f564b1ff9 100644 --- a/src/t_stream.c +++ b/src/t_stream.c @@ -1885,7 +1885,7 @@ NULL server.dirty++; notifyKeyspaceEvent(NOTIFY_STREAM,"xgroup-delconsumer", c->argv[2],c->db->id); - } else if (!strcasecmp(opt,"HELP")) { + } else if (c->argc == 2 && !strcasecmp(opt,"HELP")) { addReplyHelp(c, help); } else { addReplySubcommandSyntaxError(c); diff --git a/tests/unit/acl.tcl b/tests/unit/acl.tcl index 85c9b81a9..e81280995 100644 --- a/tests/unit/acl.tcl +++ b/tests/unit/acl.tcl @@ -255,4 +255,9 @@ start_server {tags {"acl"}} { r ACL setuser default on set e } {*NOAUTH*} + + test {ACL HELP should not have unexpected options} { + catch {r ACL help xxx} e + assert_match "*Unknown subcommand or wrong number of arguments*" $e + } } diff --git a/tests/unit/latency-monitor.tcl b/tests/unit/latency-monitor.tcl index d76867cc6..18b9ecebb 100644 --- a/tests/unit/latency-monitor.tcl +++ b/tests/unit/latency-monitor.tcl @@ -67,4 +67,9 @@ start_server {tags {"latency-monitor"}} { } assert_match {*expire-cycle*} [r latency latest] } + + test {LATENCY HELP should not have unexpected options} { + catch {r LATENCY help xxx} e + assert_match "*Unknown subcommand or wrong number of arguments*" $e + } } diff --git a/tests/unit/type/stream.tcl b/tests/unit/type/stream.tcl index c2b524d7f..0ff570cab 100644 --- a/tests/unit/type/stream.tcl +++ b/tests/unit/type/stream.tcl @@ -461,3 +461,10 @@ start_server {tags {"stream"} overrides {appendonly yes aof-use-rdb-preamble no} assert {[dict get [r xinfo stream mystream] last-generated-id] == "2-2"} } } + +start_server {tags {"stream"}} { + test {XGROUP HELP should not have unexpected options} { + catch {r XGROUP help xxx} e + assert_match "*Unknown subcommand or wrong number of arguments*" $e + } +}