From d727f527238f632d5aebb03dcde0440b4f65255b Mon Sep 17 00:00:00 2001 From: Valentino Geron Date: Sun, 23 Aug 2020 12:19:41 +0300 Subject: [PATCH] Assert that setDeferredAggregateLen isn't called with negative value In case the redis is about to return broken reply we want to crash with assert so that we are notified about the bug. see #7687. (cherry picked from commit 7e6c9ef8819a071679f8dd18035dbbe2455c7b12) --- src/networking.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/networking.c b/src/networking.c index 31c6664c7..e267565a6 100644 --- a/src/networking.c +++ b/src/networking.c @@ -492,6 +492,7 @@ void *addReplyDeferredLen(client *c) { /* Populate the length object and try gluing it to the next chunk. */ void setDeferredAggregateLen(client *c, void *node, long length, char prefix) { + serverAssert(length >= 0); listNode *ln = (listNode*)node; clientReplyBlock *next; char lenstr[128];