summaryrefslogtreecommitdiff
path: root/src/blocked.c
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2017-09-11 11:06:53 +0200
committerantirez <antirez@gmail.com>2017-12-01 10:24:24 +0100
commitc128190026efd36e8b472d8874f7f54c79ba3e06 (patch)
treeb6e1e6ae57721f2da0161e9efacc73228d2ef871 /src/blocked.c
parent6468cb2e825cf8258654f83e82324332e9879745 (diff)
downloadredis-c128190026efd36e8b472d8874f7f54c79ba3e06.tar.gz
Streams: fix handleClientsBlockedOnKeys() access to invalid ID.
Diffstat (limited to 'src/blocked.c')
-rw-r--r--src/blocked.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/blocked.c b/src/blocked.c
index 3cf661aa8..519a402cf 100644
--- a/src/blocked.c
+++ b/src/blocked.c
@@ -311,9 +311,12 @@ void handleClientsBlockedOnKeys(void) {
(s->last_id.ms == gt->ms &&
s->last_id.seq > gt->seq))
{
- unblockClient(receiver);
streamID start = *gt;
start.seq++; /* Can't overflow, it's an uint64_t */
+ /* Note that after we unblock the client, 'gt'
+ * is no longer valid, so we must do it after
+ * we copied the ID into the 'start' variable. */
+ unblockClient(receiver);
/* Emit the two elements sub-array consisting of
* the name of the stream and the data we