summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormichele papalini <micpapal@cisco.com>2019-12-13 20:19:59 +0100
committermichele papalini <micpapal@cisco.com>2019-12-13 20:19:59 +0100
commit5beae2545c8006c984003374e8de04532a7d5c03 (patch)
tree06aa6d95915325e761f65823ed87297f14d9865e
parentdd0ff3132ee80784efdf736c85813e609be762bf (diff)
[HICN-454] Use-after-free during LRU eviction in hicn-light Content Store
Signed-off-by: michele papalini <micpapal@cisco.com> Change-Id: I18e6d6612a45cd8fb7a46155760b94e0fe4e2bbe
-rw-r--r--hicn-light/src/hicn/content_store/contentStoreLRU.c5
1 files changed, 5 insertions, 0 deletions
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)) {