SCAN requires at least 1 argument

This commit is contained in:
Pieter Noordhuis
2012-07-10 15:51:43 -07:00
committed by antirez
parent 7f490b197f
commit 7a6cfb18f3
2 changed files with 3 additions and 1 deletions

View File

@ -337,6 +337,8 @@ void scanCommand(redisClient *c) {
sds pat;
int patlen, patnoop = 1;
redisAssert(c->argc >= 2);
/* Use sscanf because we need an *unsigned* long */
rv = sscanf(c->argv[1]->ptr, "%lu", &cursor);
if (rv != 1) {