[Forensics-changes] [yara] 34/160: Do not recompute match chain lengths

Hilko Bengen bengen at moszumanska.debian.org
Sat Jul 1 10:29:15 UTC 2017


This is an automated email from the git hooks/post-receive script.

bengen pushed a commit to annotated tag v3.4.0
in repository yara.

commit 8b7eb764e70e8e45de4e935ccb620965c5a33b9e
Author: Christian Blichmann <cblichmann at google.com>
Date:   Wed Mar 11 12:09:30 2015 +0100

    Do not recompute match chain lengths
---
 libyara/scan.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/libyara/scan.c b/libyara/scan.c
index a5179ec..db7fe87 100644
--- a/libyara/scan.c
+++ b/libyara/scan.c
@@ -327,12 +327,13 @@ void _yr_scan_update_match_chain_length(
   YR_MATCH* match;
   size_t ending_offset;
 
+  if (match_to_update->chain_length == chain_length)
+    return;
   match_to_update->chain_length = chain_length;
 
-  if (string->chained_to != NULL)
-    match = string->chained_to->unconfirmed_matches[tidx].head;
-  else
-    match = NULL;
+  if (string->chained_to == NULL)
+    return;
+  match = string->chained_to->unconfirmed_matches[tidx].head;
 
   while (match != NULL)
   {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/forensics/yara.git



More information about the forensics-changes mailing list