[Forensics-changes] [yara] 158/407: Fix issue with functions declared in a structure contained in an array

Hilko Bengen bengen at moszumanska.debian.org
Sat Jul 1 10:28:21 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 3c4b2466b84369b301647cf6499bdc0f9ec11e35
Author: Victor M. Alvarez <plusvic at gmail.com>
Date:   Wed Oct 29 15:47:10 2014 +0100

    Fix issue with functions declared in a structure contained in an array
---
 libyara/object.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/libyara/object.c b/libyara/object.c
index 86caf74..7e3361c 100644
--- a/libyara/object.c
+++ b/libyara/object.c
@@ -519,6 +519,8 @@ int yr_object_copy(
 
   YR_ARRAY_ITEMS* array_items;
   YR_STRUCTURE_MEMBER* structure_member;
+  YR_OBJECT_FUNCTION* func;
+  YR_OBJECT_FUNCTION* func_copy;
 
   int i;
 
@@ -544,6 +546,20 @@ int yr_object_copy(
       ((YR_OBJECT_REGEXP*) copy)->value = NULL;
       break;
 
+    case OBJECT_TYPE_FUNCTION:
+
+      func = (YR_OBJECT_FUNCTION*) object;
+      func_copy = (YR_OBJECT_FUNCTION*) copy;
+
+      FAIL_ON_ERROR_WITH_CLEANUP(
+        yr_object_copy(func->return_obj, &func_copy->return_obj),
+        yr_object_destroy(copy));
+
+      for (i = 0; i < MAX_OVERLOADED_FUNCTIONS; i++)
+        func_copy->prototypes[i] = func->prototypes[i];
+
+      break;
+
     case OBJECT_TYPE_STRUCTURE:
 
       structure_member = ((YR_OBJECT_STRUCTURE*) object)->members;

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