mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-23 00:28:26 -05: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
|
||||
* so we have a few shared objects to use if the integer is small
|
||||
* 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]);
|
||||
return;
|
||||
} else if (prefix == '$' && ll < REDIS_SHARED_BULKHDR_LEN) {
|
||||
} else if (prefix == '$' && ll < REDIS_SHARED_BULKHDR_LEN && ll >= 0) {
|
||||
addReply(c,shared.bulkhdr[ll]);
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user