Commit 79a1c19a authored by antirez's avatar antirez
Browse files

XADD MAXLEN should return an error for values < 0.

parent 2e0ab4a8
......@@ -1105,6 +1105,11 @@ void xaddCommand(client *c) {
}
if (getLongLongFromObjectOrReply(c,c->argv[i+1],&maxlen,NULL)
!= C_OK) return;
if (maxlen < 0) {
addReplyError(c,"The MAXLEN argument must be equal or greater than zero. A value of zero means that no trimming should be performed.");
return;
}
i++;
maxlen_arg_idx = i;
} else {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment