From 5beae2545c8006c984003374e8de04532a7d5c03 Mon Sep 17 00:00:00 2001 From: michele papalini Date: Fri, 13 Dec 2019 20:19:59 +0100 Subject: [HICN-454] Use-after-free during LRU eviction in hicn-light Content Store Signed-off-by: michele papalini Change-Id: I18e6d6612a45cd8fb7a46155760b94e0fe4e2bbe --- hicn-light/src/hicn/content_store/contentStoreLRU.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'hicn-light') diff --git a/hicn-light/src/hicn/content_store/contentStoreLRU.c b/hicn-light/src/hicn/content_store/contentStoreLRU.c index 847d7a90e..76a2c8659 100644 --- a/hicn-light/src/hicn/content_store/contentStoreLRU.c +++ b/hicn-light/src/hicn/content_store/contentStoreLRU.c @@ -240,6 +240,11 @@ static bool _contentStoreLRU_PutContent(ContentStoreInterface *storeImpl, return false; } + ContentStoreEntry *storeEntry = parcHashCodeTable_Get(store->storageByName, content); + if(storeEntry){ + _contentStoreLRU_PurgeStoreEntry(store, storeEntry); + } + uint64_t expiryTimeTicks = contentStoreEntry_MaxExpiryTime; if (message_HasContentExpiryTime(content)) { -- cgit 1.2.3-korg