Commit 8b428cf0 authored by Valentino Geron's avatar Valentino Geron Committed by Oran Agra
Browse files

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.
parent 9204a9b2
...@@ -492,6 +492,7 @@ void *addReplyDeferredLen(client *c) { ...@@ -492,6 +492,7 @@ void *addReplyDeferredLen(client *c) {
/* Populate the length object and try gluing it to the next chunk. */ /* Populate the length object and try gluing it to the next chunk. */
void setDeferredAggregateLen(client *c, void *node, long length, char prefix) { void setDeferredAggregateLen(client *c, void *node, long length, char prefix) {
serverAssert(length >= 0);
listNode *ln = (listNode*)node; listNode *ln = (listNode*)node;
clientReplyBlock *next; clientReplyBlock *next;
char lenstr[128]; char lenstr[128];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment