[Forensics-changes] [yara] 336/415: Improve Aho-Corasick automaton printing

Hilko Bengen bengen at moszumanska.debian.org
Thu Apr 3 05:43:21 UTC 2014


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

bengen pushed a commit to branch debian
in repository yara.

commit 967157e8d88fcd6ce4d05e70be80b9f96cc44db8
Author: Victor Manuel Alvarez <vmalvarez at virustotal.com>
Date:   Sun Dec 22 23:50:00 2013 +0100

    Improve Aho-Corasick automaton printing
---
 libyara/ahocorasick.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/libyara/ahocorasick.c b/libyara/ahocorasick.c
index b8bf33c..4731366 100644
--- a/libyara/ahocorasick.c
+++ b/libyara/ahocorasick.c
@@ -649,11 +649,21 @@ void _yr_ac_print_automaton_state(
     }
     else if (STRING_IS_REGEXP(match->string))
     {
-      printf("/%s/", match->string->string);
+      printf("/");
+
+      for (i = 0; i < min(match->string->length, 10); i++)
+        printf("%c", match->string->string[i]);
+
+      printf("/");
     }
     else
     {
-      printf("\"%s\"", match->string->string);
+      printf("\"");
+
+      for (i = 0; i < min(match->string->length, 10); i++)
+        printf("%c", match->string->string[i]);
+
+      printf("\"");
     }
 
     match = match->next;

-- 
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