diff --git a/clamonacc/inotif/hash.c b/clamonacc/inotif/hash.c index 90091cec88..6bc155fc3a 100644 --- a/clamonacc/inotif/hash.c +++ b/clamonacc/inotif/hash.c @@ -262,6 +262,7 @@ int onas_ht_insert(struct onas_ht *ht, struct onas_element *elem) bckt = ht->htable[idx]; } + /* Init activated buckets */ if (ht->nbckts == 0) { ht->head = bckt; ht->tail = bckt; diff --git a/clamonacc/inotif/hash.h b/clamonacc/inotif/hash.h index cc1491e5d0..4d1ade79ea 100644 --- a/clamonacc/inotif/hash.h +++ b/clamonacc/inotif/hash.h @@ -45,15 +45,15 @@ struct onas_bucket { struct onas_element *head; struct onas_element *tail; - struct onas_bucket *next; - struct onas_bucket *prev; + struct onas_bucket *next; /* Next activated bucket */ + struct onas_bucket *prev; /* Prev activated bucket */ }; struct onas_ht { struct onas_bucket **htable; - struct onas_bucket *head; - struct onas_bucket *tail; + struct onas_bucket *head; /* Activated buckets head */ + struct onas_bucket *tail; /* Activated buckets tail */ /* Must be a sufficiently high power of two--will not grow. */ uint32_t size; diff --git a/clamonacc/inotif/inotif.c b/clamonacc/inotif/inotif.c index 8aec36adf4..96fa97b893 100644 --- a/clamonacc/inotif/inotif.c +++ b/clamonacc/inotif/inotif.c @@ -532,6 +532,7 @@ void *onas_ddd_th(void *arg) if ((pt = optget(ctx->clamdopts, "OnAccessExcludePath"))->enabled) { while (pt) { struct onas_bucket *ob = ddd_ht->head; + /* Iterate through the activated buckets to find matched paths */ while (ob != NULL) { struct onas_element *oe = ob->head; while (oe != NULL) {