[Forensics-changes] [yara] 20/368: Fix bug causing external variable defined as -d s="." being handled as a float instead of a string

Hilko Bengen bengen at moszumanska.debian.org
Sat Jul 1 10:30:06 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 0cdf30d41d6902431377edccda4a6dcffefa50bd
Author: Victor M. Alvarez <plusvic at gmail.com>
Date:   Thu Jul 2 15:59:30 2015 +0200

    Fix bug causing external variable defined as -d s="." being handled as a float instead of a string
---
 yara.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/yara.c b/yara.c
index 0b029ef..0d938fb 100644
--- a/yara.c
+++ b/yara.c
@@ -710,9 +710,12 @@ int is_float(
 {
   int has_dot = FALSE;
 
-  if (*str == '-')
+  if (*str == '-')      // skip the minus sign if present
     str++;
 
+  if (*str == '.')      // float can't start with a dot
+    return FALSE;
+
   while(*str)
   {
     if (*str == '.')

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