[Forensics-changes] [yara] 276/368: Make yr_rules_define_* fail if variable does not exist

Hilko Bengen bengen at moszumanska.debian.org
Sat Jul 1 10:30:47 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 3795321dbb8936fa86daff68d4d05145b05a8044
Author: Hilko Bengen <bengen at hilluzination.de>
Date:   Thu May 12 18:24:15 2016 +0200

    Make yr_rules_define_* fail if variable does not exist
---
 libyara/rules.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/libyara/rules.c b/libyara/rules.c
index c655d90..0f1f48d 100644
--- a/libyara/rules.c
+++ b/libyara/rules.c
@@ -53,13 +53,13 @@ YR_API int yr_rules_define_integer_variable(
     if (strcmp(external->identifier, identifier) == 0)
     {
       external->value.i = value;
-      break;
+      return ERROR_SUCCESS;
     }
 
     external++;
   }
 
-  return ERROR_SUCCESS;
+  return ERROR_INVALID_ARGUMENT;
 }
 
 
@@ -77,13 +77,13 @@ YR_API int yr_rules_define_boolean_variable(
     if (strcmp(external->identifier, identifier) == 0)
     {
       external->value.i = value;
-      break;
+      return ERROR_SUCCESS;
     }
 
     external++;
   }
 
-  return ERROR_SUCCESS;
+  return ERROR_INVALID_ARGUMENT;
 }
 
 
@@ -101,13 +101,13 @@ YR_API int yr_rules_define_float_variable(
     if (strcmp(external->identifier, identifier) == 0)
     {
       external->value.f = value;
-      break;
+      return ERROR_SUCCESS;
     }
 
     external++;
   }
 
-  return ERROR_SUCCESS;
+  return ERROR_INVALID_ARGUMENT;
 }
 
 
@@ -142,7 +142,7 @@ YR_API int yr_rules_define_string_variable(
     external++;
   }
 
-  return ERROR_SUCCESS;
+  return ERROR_INVALID_ARGUMENT;
 }
 
 

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