From 8d8755c7b56069646ab0bd02e46652bfee19fcd1 Mon Sep 17 00:00:00 2001 From: antirez Date: Tue, 6 Mar 2018 12:55:41 +0100 Subject: [PATCH] CG: throw an error if XREADGROUP is used without GROUP. --- src/t_stream.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/t_stream.c b/src/t_stream.c index a2404244..e2908d2c 100644 --- a/src/t_stream.c +++ b/src/t_stream.c @@ -1131,6 +1131,13 @@ void xreadCommand(client *c) { return; } + /* If the user specified XREADGROUP then it must also + * provide the GROUP option. */ + if (xreadgroup && groupname == NULL) { + addReplyError(c,"Missing GROUP option for XREADGROUP"); + return; + } + /* Parse the IDs and resolve the group name. */ if (streams_count > STREAMID_STATIC_VECTOR_LEN) ids = zmalloc(sizeof(streamID)*streams_count);