[Forensics-changes] [yara] 71/407: Fix early returns.

Hilko Bengen bengen at moszumanska.debian.org
Sat Jul 1 10:28:11 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 719995cb0dddfe90fd883b384bf54d35d99c50ce
Author: Wesley Shields <wxs at atarininja.org>
Date:   Thu Sep 25 22:51:43 2014 -0400

    Fix early returns.
---
 libyara/modules/pe.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libyara/modules/pe.c b/libyara/modules/pe.c
index 4b698f8..b8b8590 100644
--- a/libyara/modules/pe.c
+++ b/libyara/modules/pe.c
@@ -2332,7 +2332,7 @@ define_function(imphash)
 
   // If not a PE, return 0.
   if (!pe)
-    return_integer(result);
+    return_integer(UNDEFINED);
 
   md5_init(&ctx);
 
@@ -2615,6 +2615,9 @@ define_function(imports)
   YR_OBJECT* module = module();
   PE* pe = (PE*) module->data;
 
+  if (!pe)
+    return_integer(UNDEFINED);
+
   cur_dll_node = pe->imports;
   while (cur_dll_node)
   {

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