From 77269fbb2c5d6b6621a8c9198d8a3e2c02090e26 Mon Sep 17 00:00:00 2001 From: Ken Steele Date: Mon, 17 Nov 2014 10:24:27 -0500 Subject: [PATCH] Fix missing use of MpmAddPid() Found by Victor using ASAN. One place was not checking to resize the pid array before adding a new PID. --- src/util-mpm-ac.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/util-mpm-ac.c b/src/util-mpm-ac.c index 7df1caa2a9..01263d177f 100644 --- a/src/util-mpm-ac.c +++ b/src/util-mpm-ac.c @@ -1377,8 +1377,7 @@ uint32_t SCACSearch(MpmCtx *mpm_ctx, MpmThreadCtx *mpm_thread_ctx, } else { pmq->pattern_id_bitarray[(lower_pid) / 8] |= (1 << ((lower_pid) % 8)); bitarray[(lower_pid) / 8] |= (1 << ((lower_pid) % 8)); - pmq->pattern_id_array[pmq->pattern_id_array_cnt++] = lower_pid; - + MpmAddPid(pmq, lower_pid); MpmAddSids(pmq, pid_pat_list[lower_pid].sids, pid_pat_list[lower_pid].sids_size); } matches++; @@ -1388,8 +1387,7 @@ uint32_t SCACSearch(MpmCtx *mpm_ctx, MpmThreadCtx *mpm_thread_ctx, } else { pmq->pattern_id_bitarray[(pids[k]) / 8] |= (1 << ((pids[k]) % 8)); bitarray[pids[k] / 8] |= (1 << (pids[k] % 8)); - pmq->pattern_id_array[pmq->pattern_id_array_cnt++] = pids[k]; - + MpmAddPid(pmq, pids[k]); MpmAddSids(pmq, pid_pat_list[pids[k]].sids, pid_pat_list[pids[k]].sids_size); } matches++;