mirror of
https://github.com/Cisco-Talos/clamav.git
synced 2026-05-24 08:17:53 -04:00
When onas_ht_insert() adds an element whose hash maps to an existing bucket, the bucket is already part of the activated-bucket list. The old code appended that same bucket to the list again, resetting bckt->next to NULL and making any following buckets unreachable from ht->head. OnAccessExcludePath walks the activated-bucket list when removing watched paths. If a collision corrupts that list, some active directories can be skipped and remain watched. Track whether onas_ht_insert() allocated a new bucket, and only link the bucket into ht->head/ht->tail when it is new. Colliding elements are still inserted into the existing bucket without changing the bucket list.