[Forensics-changes] [yara] 12/368: Treat external variables defined as integers unless they contain a dot

Hilko Bengen bengen at moszumanska.debian.org
Sat Jul 1 10:30:05 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 be2c1b8081d80c3710de8e28d72a7b77343898db
Author: Victor M. Alvarez <plusvic at gmail.com>
Date:   Tue Jun 30 20:58:25 2015 +0200

    Treat external variables defined as integers unless they contain a dot
    
    The command line argument -d n=5 was defining "n" as a float instead of an integer. Now if you want a float you must use -d n=5.0
---
 yara.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/yara.c b/yara.c
index 3c4ddb8..0b029ef 100644
--- a/yara.c
+++ b/yara.c
@@ -708,7 +708,7 @@ int is_integer(
 int is_float(
     const char *str)
 {
-  int point = FALSE;
+  int has_dot = FALSE;
 
   if (*str == '-')
     str++;
@@ -717,18 +717,20 @@ int is_float(
   {
     if (*str == '.')
     {
-      if (point)      // two points seen, not a float
+      if (has_dot)      // two dots, not a float
         return FALSE;
-      point = TRUE;
+
+      has_dot = TRUE;
     }
     else if (!isdigit(*str))
     {
       return FALSE;
     }
+
     str++;
   }
 
-  return TRUE;
+  return has_dot; // to be float must contain a dot
 }
 
 

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