[Forensics-changes] [yara] 138/368: Fixes for #388
Hilko Bengen
bengen at moszumanska.debian.org
Sat Jul 1 10:30:20 UTC 2017
This is an automated email from the git hooks/post-receive script.
bengen pushed a commit to annotated tag v3.5.0
in repository yara.
commit fa788ca16518482fa94135ec2fbe06b72b1d1e46
Author: AB <AB at null.com>
Date: Sat Jan 9 12:49:57 2016 -0800
Fixes for #388
---
libyara/Makefile.am | 2 ++
libyara/exec.c | 1 +
libyara/modules/demo.c | 15 +++++++++++++++
libyara/modules/module_list | 2 ++
4 files changed, 20 insertions(+)
diff --git a/libyara/Makefile.am b/libyara/Makefile.am
index 049dccc..61de811 100644
--- a/libyara/Makefile.am
+++ b/libyara/Makefile.am
@@ -16,6 +16,8 @@ if HASH
MODULES += modules/hash.c
endif
+MODULES += modules/demo.c
+
#
# Add your modules here:
#
diff --git a/libyara/exec.c b/libyara/exec.c
index 110d08f..29e562e 100644
--- a/libyara/exec.c
+++ b/libyara/exec.c
@@ -504,6 +504,7 @@ int yr_execute_code(
pop(r2); // dictionary
ensure_defined(r1);
+ ensure_defined(r2);
assert(r2.o->type == OBJECT_TYPE_DICTIONARY);
r1.o = yr_object_dict_get_item(
diff --git a/libyara/modules/demo.c b/libyara/modules/demo.c
index 1906a2f..53ff321 100644
--- a/libyara/modules/demo.c
+++ b/libyara/modules/demo.c
@@ -22,6 +22,17 @@ begin_declarations;
declare_string("greeting");
+ begin_struct_dictionary("d1");
+ declare_integer("i1");
+ end_struct_dictionary("d1");
+
+ begin_struct_dictionary("d2");
+ declare_integer("i2");
+ begin_struct_dictionary("d2_2");
+ declare_integer("i3");
+ end_struct_dictionary("d2_2");
+ end_struct_dictionary("d2");
+
end_declarations;
@@ -47,6 +58,10 @@ int module_load(
{
set_string("Hello World!", module_object, "greeting");
+ set_integer(5, module_object, "d1[\"abc\"].i1");
+ set_integer(5, module_object, "d2[\"def\"].i2");
+ set_integer(5, module_object, "d2[\"def\"].d2_2[\"ghi\"].i3");
+
return ERROR_SUCCESS;
}
diff --git a/libyara/modules/module_list b/libyara/modules/module_list
index 1a0bd02..095ac2a 100644
--- a/libyara/modules/module_list
+++ b/libyara/modules/module_list
@@ -14,3 +14,5 @@ MODULE(magic)
#ifdef HASH
MODULE(hash)
#endif
+
+MODULE(demo)
--
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