Bug in ndpi_lru_find_cache (#1204)

Key value check is missing.
This commit is contained in:
Vitaly Lavrov
2021-06-10 11:06:19 +02:00
committed by GitHub
parent 1a8ae710cf
commit 6704649a75
+1 -1
View File
@@ -7035,7 +7035,7 @@ u_int8_t ndpi_lru_find_cache(struct ndpi_lru_cache *c, u_int32_t key,
u_int16_t *value, u_int8_t clean_key_when_found) {
u_int32_t slot = key % c->num_entries;
if(c->entries[slot].is_full) {
if(c->entries[slot].is_full && c->entries[slot].key == key) {
*value = c->entries[slot].value;
if(clean_key_when_found)
c->entries[slot].is_full = 0;