[Forensics-changes] [yara] 185/368: Spelling stack_sz & stacksize -> stack_size. Make it signed int type.

Hilko Bengen bengen at moszumanska.debian.org
Sat Jul 1 10:30:34 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 04b43679c8a79b22de9a42a63e1877993b2d1e30
Author: Coleman Kane <ckane at colemankane.org>
Date:   Thu Feb 25 19:57:52 2016 -0500

    Spelling stack_sz & stacksize -> stack_size. Make it signed int type.
---
 libyara/exec.c | 8 ++++----
 yara.c         | 8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/libyara/exec.c b/libyara/exec.c
index f8f4d4d..9899447 100644
--- a/libyara/exec.c
+++ b/libyara/exec.c
@@ -50,7 +50,7 @@ typedef union _STACK_ITEM {
 
 #define push(x)  \
     do { \
-      if (sp < stack_sz) stack[sp++] = (x); \
+      if (sp < stack_size) stack[sp++] = (x); \
       else return ERROR_EXEC_STACK_OVERFLOW; \
     } while(0)
 
@@ -183,15 +183,15 @@ int yr_execute_code(
   int stop = FALSE;
   int cycle = 0;
   int tidx = context->tidx;
-  unsigned int stack_sz;
+  int stack_size;
 
   #ifdef PROFILING_ENABLED
   clock_t start = clock();
   #endif
 
-  yr_get_configuration(YR_CONFIG_STACK_SIZE, (void*)&stack_sz);
+  yr_get_configuration(YR_CONFIG_STACK_SIZE, (void*)&stack_size);
 
-  stack = (STACK_ITEM *) yr_malloc(stack_sz * sizeof(STACK_ITEM));
+  stack = (STACK_ITEM *) yr_malloc(stack_size * sizeof(STACK_ITEM));
 
   if (stack == NULL)
     return ERROR_INSUFICIENT_MEMORY;
diff --git a/yara.c b/yara.c
index 4b00918..c9494ad 100644
--- a/yara.c
+++ b/yara.c
@@ -110,7 +110,7 @@ int negate = FALSE;
 int count = 0;
 int limit = 0;
 int timeout = 1000000;
-unsigned int stacksize = DEFAULT_STACK_SIZE;
+int stack_size = DEFAULT_STACK_SIZE;
 int threads = 8;
 
 
@@ -159,7 +159,7 @@ args_option_t options[] =
   OPT_INTEGER('a', "timeout", &timeout,
       "abort scanning after the given number of SECONDS", "SECONDS"),
 
-  OPT_INTEGER('k', "stack-size", &stacksize,
+  OPT_INTEGER('k', "stack-size", &stack_size,
       "Set stack size to allocate in exec() to SLOTS (default=16384)", "SLOTS"),
 
   OPT_BOOLEAN('r', "recursive", &recursive_search,
@@ -1005,10 +1005,10 @@ int main(
 
   result = yr_initialize();
 
-  if(stacksize != DEFAULT_STACK_SIZE) {
+  if(stack_size != DEFAULT_STACK_SIZE) {
     // If the user chose a different stack size than default,
     // modify the yara config here
-    yr_set_configuration(YR_CONFIG_STACK_SIZE, &stacksize);
+    yr_set_configuration(YR_CONFIG_STACK_SIZE, &stack_size);
   }
 
   if (result != ERROR_SUCCESS)

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