[Forensics-changes] [yara] 236/368: Re-styling changes

Hilko Bengen bengen at moszumanska.debian.org
Sat Jul 1 10:30:43 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 138a05de8d9c79a6cc469da039df0f56dd87fedb
Author: plusvic <plusvic at gmail.com>
Date:   Mon Mar 21 16:30:00 2016 +0100

    Re-styling changes
---
 yara.c | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/yara.c b/yara.c
index c9494ad..8560332 100644
--- a/yara.c
+++ b/yara.c
@@ -160,7 +160,7 @@ args_option_t options[] =
       "abort scanning after the given number of SECONDS", "SECONDS"),
 
   OPT_INTEGER('k', "stack-size", &stack_size,
-      "Set stack size to allocate in exec() to SLOTS (default=16384)", "SLOTS"),
+      "set maximum stack size (default=16384)", "SLOTS"),
 
   OPT_BOOLEAN('r', "recursive", &recursive_search,
       "recursively search directories"),
@@ -485,6 +485,10 @@ void print_scanner_error(
     case ERROR_CORRUPT_FILE:
       fprintf(stderr, "corrupt compiled rules file.\n");
       break;
+    case ERROR_EXEC_STACK_OVERFLOW:
+      fprintf(stderr, "stack overflow while evaluating condition "
+                      "(see --stack-size argument).\n");
+      break;
     default:
       fprintf(stderr, "internal error: %d\n", error);
       break;
@@ -1005,18 +1009,20 @@ int main(
 
   result = yr_initialize();
 
-  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, &stack_size);
-  }
-
   if (result != ERROR_SUCCESS)
   {
     fprintf(stderr, "error: initialization error (%d)\n", result);
     exit_with_code(EXIT_FAILURE);
   }
 
+  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, &stack_size);
+  }
+
   // Try to load the rules file as a binary file containing
   // compiled rules first
 

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