From fdaea2a7a7eed1499f46bb98552f8d8bb8dc7e9d Mon Sep 17 00:00:00 2001 From: antirez Date: Thu, 31 Oct 2019 18:07:33 +0100 Subject: Modules: fix thread safe context creation crash. See #6525, this likely creates a NULL deference if the client was terminated by Redis between the creation of the blocked client and the creation of the thread safe context. --- src/module.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/module.c b/src/module.c index f298ec760..f9f654b42 100644 --- a/src/module.c +++ b/src/module.c @@ -4463,7 +4463,7 @@ RedisModuleCtx *RM_GetThreadSafeContext(RedisModuleBlockedClient *bc) { ctx->client = createClient(NULL); if (bc) { selectDb(ctx->client,bc->dbid); - ctx->client->id = bc->client->id; + if (bc->client) ctx->client->id = bc->client->id; } return ctx; } -- cgit v1.2.1