From edeaf85cab10b2d9bc151363779f70822d679472 Mon Sep 17 00:00:00 2001 From: Itamar Haber Date: Wed, 17 Oct 2018 19:33:11 +0300 Subject: [PATCH] Plugs a potential underflow --- src/t_stream.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/t_stream.c b/src/t_stream.c index 6244c784..e4c9fed5 100644 --- a/src/t_stream.c +++ b/src/t_stream.c @@ -1921,6 +1921,7 @@ void xpendingCommand(client *c) { if (c->argc >= 6) { if (getLongLongFromObjectOrReply(c,c->argv[5],&count,NULL) == C_ERR) return; + if (count < 0) count = 0; if (streamParseIDOrReply(c,c->argv[3],&startid,0) == C_ERR) return; if (streamParseIDOrReply(c,c->argv[4],&endid,UINT64_MAX) == C_ERR)