[Forensics-changes] [yara] 19/407: Fix issue #169

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


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

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

commit 76dee582bf5ba783d5e3897ef430429ac13dfdaf
Author: Victor Manuel Alvarez <vmalvarez at virustotal.com>
Date:   Fri Sep 5 17:01:33 2014 +0200

    Fix issue #169
---
 libyara/exec.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/libyara/exec.c b/libyara/exec.c
index d7f3344..a8aae87 100644
--- a/libyara/exec.c
+++ b/libyara/exec.c
@@ -523,7 +523,7 @@ int yr_execute_code(
 
         if (IS_UNDEFINED(r1) || IS_UNDEFINED(r2))
         {
-          push(0);
+          push(UNDEFINED);
           break;
         }
 
@@ -653,8 +653,12 @@ int yr_execute_code(
       case OP_CONTAINS:
         pop(r2);
         pop(r1);
-        push(strstr(UINT64_TO_PTR(char*, r1),
-                    UINT64_TO_PTR(char*, r2)) != NULL);
+
+        if (IS_UNDEFINED(r1) || IS_UNDEFINED(r2))
+          push(UNDEFINED);
+        else
+          push(strstr(UINT64_TO_PTR(char*, r1),
+                      UINT64_TO_PTR(char*, r2)) != NULL);
         break;
 
       case OP_IMPORT:

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