diff options
author | Jan-Erik Rediger <badboy@archlinux.us> | 2014-06-29 12:32:06 +0200 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2014-08-27 10:24:19 +0200 |
commit | 07b2779bff0e95213a80b8a26c8459c3a44e3325 (patch) | |
tree | a9d334a58c22169c7d6577b3c6b0a74e645f7f34 /src | |
parent | 4024220fe6ab7a233c7ea8d97f5498136285fdaf (diff) | |
download | redis-07b2779bff0e95213a80b8a26c8459c3a44e3325.tar.gz |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/t_string.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/t_string.c b/src/t_string.c index 41e4b3b71..397363c5c 100644 --- a/src/t_string.c +++ b/src/t_string.c @@ -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. */ |