[Forensics-changes] [yara] 319/407: Fix warning due to uninitialised variable with certain compilers

Hilko Bengen bengen at moszumanska.debian.org
Sat Jul 1 10:28:40 UTC 2017


This is an automated email from the git hooks/post-receive script.

bengen pushed a commit to annotated tag v3.3.0
in repository yara.

commit 962d5df5fdc50cb8f266e38704eab615206ea18d
Author: Victor M. Alvarez <plusvic at gmail.com>
Date:   Mon Jan 5 13:58:45 2015 +0100

    Fix warning due to uninitialised variable with certain compilers
---
 libyara/modules/math.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/libyara/modules/math.c b/libyara/modules/math.c
index d599887..1838440 100644
--- a/libyara/modules/math.c
+++ b/libyara/modules/math.c
@@ -353,7 +353,7 @@ define_function(string_serial_correlation)
 {
   SIZED_STRING* s = sized_string_argument(1);
 
-  double scc, sccun;
+  double sccun = 0;
   double scclast = 0;
   double scct1 = 0;
   double scct2 = 0;
@@ -370,7 +370,8 @@ define_function(string_serial_correlation)
 
   scct1 += scclast * sccun;
   scct2 *= scct2;
-  scc = s->length * scct3 - scct2;
+
+  double scc = s->length * scct3 - scct2;
 
   if (scc == 0)
     scc = -100000;

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