mirror of
https://github.com/fluencelabs/redis
synced 2025-06-16 10:41:22 +00:00
Scripting: require at least one argument for redis.call().
Redis used to crash with a call like the following: EVAL "redis.call()" 0 Now the explicit check for at least one argument prevents the problem. This commit fixes issue #655.
This commit is contained in:
@ -167,6 +167,13 @@ int luaRedisGenericCommand(lua_State *lua, int raise_error) {
|
||||
redisClient *c = server.lua_client;
|
||||
sds reply;
|
||||
|
||||
/* Require at least one argument */
|
||||
if (argc == 0) {
|
||||
luaPushError(lua,
|
||||
"Please specify at least one argument for redis.call()");
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Build the arguments vector */
|
||||
argv = zmalloc(sizeof(robj*)*argc);
|
||||
for (j = 0; j < argc; j++) {
|
||||
|
Reference in New Issue
Block a user