From f30d3e635e55717ce3edfb1b6d08637c043fd8c0 Mon Sep 17 00:00:00 2001 From: Jon Siwek Date: Mon, 10 Mar 2014 11:34:57 -0500 Subject: [PATCH] Fix non-deterministic logging of unmatched DNS msgs, addresses BIT-1153 Unmatched DNS messages may fail to be logged sometimes due to a type of iterator invalidation. --- scripts/base/protocols/dns/main.bro | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts/base/protocols/dns/main.bro b/scripts/base/protocols/dns/main.bro index 348c361311..fe371de2a8 100644 --- a/scripts/base/protocols/dns/main.bro +++ b/scripts/base/protocols/dns/main.bro @@ -181,10 +181,9 @@ function log_unmatched_msgs_queue(q: Queue::Queue) function log_unmatched_msgs(msgs: PendingMessages) { for ( trans_id in msgs ) - { log_unmatched_msgs_queue(msgs[trans_id]); - delete msgs[trans_id]; - } + + msgs = PendingMessages(); } function enqueue_new_msg(msgs: PendingMessages, id: count, msg: Info)