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 8b428cf0f7ce5489fbdf4640a1dd36357f3dc5f0)
This commit is contained in:
Valentino Geron 2020-08-23 12:19:41 +03:00 committed by Oran Agra
parent 19ef1f371d
commit 3e2ed279fd

View File

@ -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];