mirror of
https://github.com/fluencelabs/redis
synced 2025-03-19 09:00:51 +00:00
free hash table entries about no longer active classes, so that PUBSUB can be abused with millions of different classes
This commit is contained in:
parent
201037f562
commit
ff767a7580
6
redis.c
6
redis.c
@ -9312,6 +9312,12 @@ static int pubsubUnsubscribe(redisClient *c, robj *class, int notify) {
|
|||||||
ln = listSearchKey(clients,c);
|
ln = listSearchKey(clients,c);
|
||||||
assert(ln != NULL);
|
assert(ln != NULL);
|
||||||
listDelNode(clients,ln);
|
listDelNode(clients,ln);
|
||||||
|
if (listLength(clients) == 0) {
|
||||||
|
/* Free the list and associated hash entry at all if this was
|
||||||
|
* the latest client, so that it will be possible to abuse
|
||||||
|
* Redis PUBSUB creating millions of classes. */
|
||||||
|
dictDelete(server.pubsub_classes,class);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/* Notify the client */
|
/* Notify the client */
|
||||||
if (notify) {
|
if (notify) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user