mirror of
https://github.com/fluencelabs/redis
synced 2025-04-02 15:51:05 +00:00
Ensure array index is in range in addReplyLongLongWithPrefix().
Change done in order to remove a warning and improve code robustness. No actual bug here.
This commit is contained in:
parent
37260bc3be
commit
221d2932b5
@ -454,10 +454,10 @@ void addReplyLongLongWithPrefix(redisClient *c, long long ll, char prefix) {
|
|||||||
/* Things like $3\r\n or *2\r\n are emitted very often by the protocol
|
/* Things like $3\r\n or *2\r\n are emitted very often by the protocol
|
||||||
* so we have a few shared objects to use if the integer is small
|
* so we have a few shared objects to use if the integer is small
|
||||||
* like it is most of the times. */
|
* like it is most of the times. */
|
||||||
if (prefix == '*' && ll < REDIS_SHARED_BULKHDR_LEN) {
|
if (prefix == '*' && ll < REDIS_SHARED_BULKHDR_LEN && ll >= 0) {
|
||||||
addReply(c,shared.mbulkhdr[ll]);
|
addReply(c,shared.mbulkhdr[ll]);
|
||||||
return;
|
return;
|
||||||
} else if (prefix == '$' && ll < REDIS_SHARED_BULKHDR_LEN) {
|
} else if (prefix == '$' && ll < REDIS_SHARED_BULKHDR_LEN && ll >= 0) {
|
||||||
addReply(c,shared.bulkhdr[ll]);
|
addReply(c,shared.bulkhdr[ll]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user