[Forensics-changes] [yara] 163/407: Fix string_argument macro to correctly handle SIZED_STRINGs

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 ccd52bc627b1828dfd10ab5781ed1e46290e2578
Author: Victor M. Alvarez <plusvic at gmail.com>
Date:   Thu Oct 30 11:52:44 2014 +0100

    Fix string_argument macro to correctly handle SIZED_STRINGs
---
 libyara/include/yara/modules.h | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/libyara/include/yara/modules.h b/libyara/include/yara/modules.h
index cdad1fc..e25539d 100644
--- a/libyara/include/yara/modules.h
+++ b/libyara/include/yara/modules.h
@@ -218,9 +218,10 @@ limitations under the License.
         YR_OBJECT_FUNCTION* __function_obj)
 
 
-#define integer_argument(n)  (((int64_t*) __args)[n-1])
-#define string_argument(n)   ((char*)((int64_t*) __args)[n-1])
-#define regexp_argument(n)   ((RE_CODE)((int64_t*) __args)[n-1])
+#define sized_string_argument(n) ((SIZED_STRING*)((int64_t*) __args)[n-1])
+#define string_argument(n)       (sized_string_argument(n)->c_string)
+#define integer_argument(n)      (((int64_t*) __args)[n-1])
+#define regexp_argument(n)       ((RE_CODE)((int64_t*) __args)[n-1])
 
 
 #define module()        yr_object_get_root((YR_OBJECT*) __function_obj)

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