From 0752a834f9311194d0d409d24ebee7349aa6c1a0 Mon Sep 17 00:00:00 2001 From: Itamar Haber Date: Thu, 30 Nov 2017 00:30:30 +0200 Subject: [PATCH] Check arity in SLOWLOG before accessing arg --- src/slowlog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/slowlog.c b/src/slowlog.c index 9d6f4f02..525fa8a0 100644 --- a/src/slowlog.c +++ b/src/slowlog.c @@ -140,7 +140,7 @@ void slowlogReset(void) { /* The SLOWLOG command. Implements all the subcommands needed to handle the * Redis slow log. */ void slowlogCommand(client *c) { - if (!strcasecmp(c->argv[1]->ptr,"help") && c->argc == 2) { + if (c->argc == 2 && !strcasecmp(c->argv[1]->ptr,"help")) { const char *help[] = { "get [count] -- Return the top entries from the slowlog (default: 10).", "len -- Return the length of the slowlog.",