From ef4256670f2c23bd3de3963c0dc4882599ac3300 Mon Sep 17 00:00:00 2001 From: Justin Brewer Date: Thu, 17 May 2018 20:19:12 -0500 Subject: Update createArray to take size_t This makes createArray consistent with createString, which also takes size_t. Bounds-check and unit tests are updated to allow up to min(SIZE_MAX,LLONG_MAX). Changelog is updated to mention this API break. Signed-off-by: Justin Brewer --- read.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'read.c') diff --git a/read.c b/read.c index ef483f7..8e9f8bf 100644 --- a/read.c +++ b/read.c @@ -385,7 +385,7 @@ static int processMultiBulkItem(redisReader *r) { root = (r->ridx == 0); - if (elements < -1 || elements > INT_MAX) { + if (elements < -1 || (LLONG_MAX > SIZE_MAX && elements > SIZE_MAX)) { __redisReaderSetError(r,REDIS_ERR_PROTOCOL, "Multi-bulk length out of range"); return REDIS_ERR; -- cgit v1.2.3