summaryrefslogtreecommitdiff
path: root/src/functions.c
diff options
context:
space:
mode:
authorMeir Shpilraien (Spielrein) <meir@redis.com>2022-01-18 10:29:52 +0200
committerGitHub <noreply@github.com>2022-01-18 10:29:52 +0200
commit51f9bed3dd8d35a59e9124e49450c9795822dbf5 (patch)
tree50429b757a1a69bedc5ceef69da60de4c74b2730 /src/functions.c
parentae89958972ee720be2bff68231d6353553c2272a (diff)
downloadredis-51f9bed3dd8d35a59e9124e49450c9795822dbf5.tar.gz
Fix `FUNCTION LOAD` ignores unknown parameter. (#10131)
Following discussion on: https://github.com/redis/redis/issues/9899#issuecomment-1014689385 Raise error if unknows parameter is given to `FUNCTION LOAD`. Before the fix: ``` 127.0.0.1:6379> function load LUA lib2 foo bar "local function test1() return 5 end redis.register_function('test1', test1)" OK ``` After the fix: ``` 127.0.0.1:6379> function load LUA lib2 foo bar "local function test1() return 5 end redis.register_function('test1', test1)" (error) ERR Unkowns option given: foo ```
Diffstat (limited to 'src/functions.c')
-rw-r--r--src/functions.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/functions.c b/src/functions.c
index 76e8c21d7..90e36231e 100644
--- a/src/functions.c
+++ b/src/functions.c
@@ -966,6 +966,8 @@ void functionLoadCommand(client *c) {
desc = c->argv[argc_pos++]->ptr;
continue;
}
+ addReplyErrorFormat(c, "Unknown option given: %s", (char*)next_arg->ptr);
+ return;
}
if (argc_pos >= c->argc) {