Fix OBJECT arity

Previously, the command definition for the OBJECT command specified
a minimum of two args (and that it was variadic), which meant that
if you sent this:

OBJECT foo

When cluster was enabled, it would result in an assertion/SEGFAULT
when Redis was attempting to extract keys.

It appears that OBJECT is not variadic, and only ever takes 3 args.

https://gist.github.com/michael-grunder/25960ce1508396d0d36a
This commit is contained in:
michael-grunder 2014-07-11 13:03:26 -07:00
parent 6382936ebc
commit ce8a68b1fd
2 changed files with 2 additions and 2 deletions

View File

@ -696,7 +696,7 @@ robj *objectCommandLookupOrReply(redisClient *c, robj *key, robj *reply) {
} }
/* Object command allows to inspect the internals of an Redis Object. /* Object command allows to inspect the internals of an Redis Object.
* Usage: OBJECT <verb> ... arguments ... */ * Usage: OBJECT <refcount|encoding|idletime> <key> */
void objectCommand(redisClient *c) { void objectCommand(redisClient *c) {
robj *o; robj *o;

View File

@ -266,7 +266,7 @@ struct redisCommand redisCommandTable[] = {
{"readonly",readonlyCommand,1,"rF",0,NULL,0,0,0,0,0}, {"readonly",readonlyCommand,1,"rF",0,NULL,0,0,0,0,0},
{"readwrite",readwriteCommand,1,"rF",0,NULL,0,0,0,0,0}, {"readwrite",readwriteCommand,1,"rF",0,NULL,0,0,0,0,0},
{"dump",dumpCommand,2,"ar",0,NULL,1,1,1,0,0}, {"dump",dumpCommand,2,"ar",0,NULL,1,1,1,0,0},
{"object",objectCommand,-2,"r",0,NULL,2,2,2,0,0}, {"object",objectCommand,3,"r",0,NULL,2,2,2,0,0},
{"client",clientCommand,-2,"ar",0,NULL,0,0,0,0,0}, {"client",clientCommand,-2,"ar",0,NULL,0,0,0,0,0},
{"eval",evalCommand,-3,"s",0,evalGetKeys,0,0,0,0,0}, {"eval",evalCommand,-3,"s",0,evalGetKeys,0,0,0,0,0},
{"evalsha",evalShaCommand,-3,"s",0,evalGetKeys,0,0,0,0,0}, {"evalsha",evalShaCommand,-3,"s",0,evalGetKeys,0,0,0,0,0},