From 319d18013646bb9c14d0c070a566d058558bf762 Mon Sep 17 00:00:00 2001 From: antirez Date: Tue, 6 Oct 2015 09:25:28 +0200 Subject: [PATCH] Fix GEORADIUS COUNT option arity checks. --- src/geo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/geo.c b/src/geo.c index d0381ce5..daff0dd9 100644 --- a/src/geo.c +++ b/src/geo.c @@ -481,7 +481,7 @@ void georadiusGeneric(client *c, int type) { sort = SORT_ASC; } else if (!strcasecmp(arg, "desc")) { sort = SORT_DESC; - } else if (!strcasecmp(arg, "count") && remaining > 0) { + } else if (!strcasecmp(arg, "count") && (i+1) < remaining) { if (getLongLongFromObjectOrReply(c, c->argv[base_args+i+1], &count, NULL) != C_OK) return; if (count <= 0) {