Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
6054089f
Commit
6054089f
authored
Apr 09, 2016
by
Itamar Haber
Committed by
antirez
May 10, 2016
Browse files
Stops SPLICE from accepting negative counts
parent
2e464bf0
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/modules/helloworld.c
View file @
6054089f
...
...
@@ -97,7 +97,8 @@ int HelloListSplice_RedisCommand(RedisModuleCtx *ctx, RedisModuleString **argv,
}
long
long
count
;
if
(
RedisModule_StringToLongLong
(
argv
[
3
],
&
count
)
!=
REDISMODULE_OK
)
{
if
((
RedisModule_StringToLongLong
(
argv
[
3
],
&
count
)
!=
REDISMODULE_OK
)
||
(
count
<
0
))
{
RedisModule_CloseKey
(
srckey
);
RedisModule_CloseKey
(
dstkey
);
return
RedisModule_ReplyWithError
(
ctx
,
"ERR invalid count"
);
...
...
@@ -141,8 +142,11 @@ int HelloListSpliceAuto_RedisCommand(RedisModuleCtx *ctx, RedisModuleString **ar
}
long
long
count
;
if
(
RedisModule_StringToLongLong
(
argv
[
3
],
&
count
)
!=
REDISMODULE_OK
)
if
((
RedisModule_StringToLongLong
(
argv
[
3
],
&
count
)
!=
REDISMODULE_OK
)
||
(
count
<
0
))
{
return
RedisModule_ReplyWithError
(
ctx
,
"ERR invalid count"
);
}
while
(
count
--
>
0
)
{
RedisModuleString
*
ele
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment