Skip to content

Commit fa5073f

Browse files
authored
Fix UAF bug (#14)
* Fix UAF bug * Fix uaf
1 parent 0bf5dcb commit fa5073f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/tairhash.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,7 @@ int delEmptyTairHashIfNeeded(RedisModuleCtx *ctx, RedisModuleKey *key, RedisModu
374374
https://github.com/redis/redis/pull/8097
375375
https://github.com/redis/redis/pull/7037
376376
*/
377+
RedisModule_CloseKey(key);
377378
RedisModuleCtx *ctx2 = RedisModule_GetThreadSafeContext(NULL);
378379
RedisModule_SelectDb(ctx2, RedisModule_GetSelectedDb(ctx));
379380
RedisModuleCallReply *reply = RedisModule_Call(ctx2, "DEL", "s!", raw_key);
@@ -508,6 +509,7 @@ void activeExpireTimerHandler(RedisModuleCtx *ctx, void *data) {
508509
m_listAddNodeTail(keys, key);
509510
}
510511
}
512+
RedisModule_CloseKey(real_key);
511513
}
512514
break;
513515
}

0 commit comments

Comments
 (0)