[Forensics-changes] [yara] 77/135: Bug fix: Start of string anchor (^) not working properly with wide strings

Hilko Bengen bengen at moszumanska.debian.org
Sat Jul 1 10:27:34 UTC 2017


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

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

commit ec5eb9f201dadf2f3b8fb7c24527e1afe48f279a
Author: Victor M. Alvarez <plusvic at gmail.com>
Date:   Thu Jul 24 17:04:08 2014 +0200

    Bug fix: Start of string anchor (^) not working properly with wide strings
---
 libyara/re.c   | 2 +-
 libyara/scan.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libyara/re.c b/libyara/re.c
index ce8256d..a51f04a 100644
--- a/libyara/re.c
+++ b/libyara/re.c
@@ -1668,7 +1668,7 @@ int yr_re_exec(
 
         case RE_OPCODE_MATCH_AT_START:
           if (flags & RE_FLAGS_BACKWARDS)
-            kill = (flags & RE_FLAGS_NOT_AT_START) || (input_size > count);
+            kill = input_size > count;
           else
             kill = (flags & RE_FLAGS_NOT_AT_START) || (count != 0);
           action = kill ? ACTION_KILL : ACTION_CONTINUE;
diff --git a/libyara/scan.c b/libyara/scan.c
index 3be2221..ad68bf1 100644
--- a/libyara/scan.c
+++ b/libyara/scan.c
@@ -671,7 +671,7 @@ int _yr_scan_verify_re_match(
         ac_match->forward_code,
         data + offset,
         data_size - offset,
-        flags,
+        offset > 0 ? flags | RE_FLAGS_NOT_AT_START : flags,
         NULL,
         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