diff --git a/src/networking.c b/src/networking.c index d62456a3fe60a315e317a59d8a7241e9d70ce78f..55b7475b4db0d70f9a65e319f642a3fc6e5f5751 100644 --- a/src/networking.c +++ b/src/networking.c @@ -253,9 +253,9 @@ void setDeferredMultiBulkLength(redisClient *c, void *node, long length) { if (ln->next != NULL) { next = listNodeValue(ln->next); - /* Only glue when the next node is an sds */ + /* Only glue when the next node is non-NULL (an sds in this case) */ if (next->ptr != NULL) { - len->ptr = sdscat(len->ptr,next->ptr); + len->ptr = sdscatlen(len->ptr,next->ptr,sdslen(next->ptr)); listDelNode(c->reply,ln->next); } }