Skip to content

Commit

Permalink
Fix UAF bug (#14)
Browse files Browse the repository at this point in the history
* Fix UAF bug

* Fix uaf
  • Loading branch information
chenyang8094 authored Nov 19, 2021
1 parent 0bf5dcb commit fa5073f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/tairhash.c
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,7 @@ int delEmptyTairHashIfNeeded(RedisModuleCtx *ctx, RedisModuleKey *key, RedisModu
https://github.com/redis/redis/pull/8097
https://github.com/redis/redis/pull/7037
*/
RedisModule_CloseKey(key);
RedisModuleCtx *ctx2 = RedisModule_GetThreadSafeContext(NULL);
RedisModule_SelectDb(ctx2, RedisModule_GetSelectedDb(ctx));
RedisModuleCallReply *reply = RedisModule_Call(ctx2, "DEL", "s!", raw_key);
Expand Down Expand Up @@ -508,6 +509,7 @@ void activeExpireTimerHandler(RedisModuleCtx *ctx, void *data) {
m_listAddNodeTail(keys, key);
}
}
RedisModule_CloseKey(real_key);
}
break;
}
Expand Down

0 comments on commit fa5073f

Please sign in to comment.