diff options
author | antirez <antirez@gmail.com> | 2019-10-31 18:07:33 +0100 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2019-10-31 18:07:33 +0100 |
commit | fdaea2a7a7eed1499f46bb98552f8d8bb8dc7e9d (patch) | |
tree | 0635e2146ff730aa3afabb793e97993c0b9c5f93 | |
parent | 1ee195d25514abe77f0d38ae681da9c923de408f (diff) | |
download | redis-fdaea2a7a7eed1499f46bb98552f8d8bb8dc7e9d.tar.gz |
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.
-rw-r--r-- | src/module.c | 2 |
1 files changed, 1 insertions, 1 deletions
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; } |