mirror of
https://github.com/fluencelabs/redis
synced 2025-06-13 01:01:22 +00:00
Handle large getrange requests
Previously the end was casted to a smaller type which resulted in a wrong check and failed with values larger than handled by unsigned. Closes #1847, #1844
This commit is contained in:
committed by
antirez
parent
f17f8521f0
commit
53fdfda9e3
@ -255,7 +255,7 @@ void getrangeCommand(redisClient *c) {
|
||||
if (end < 0) end = strlen+end;
|
||||
if (start < 0) start = 0;
|
||||
if (end < 0) end = 0;
|
||||
if ((unsigned)end >= strlen) end = strlen-1;
|
||||
if ((size_t)end >= strlen) end = strlen-1;
|
||||
|
||||
/* Precondition: end >= 0 && end < strlen, so the only condition where
|
||||
* nothing can be returned is: start > end. */
|
||||
|
Reference in New Issue
Block a user