[Forensics-changes] [yara] 182/368: Fix warning

Hilko Bengen bengen at moszumanska.debian.org
Sat Jul 1 10:30:28 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 f08b304bd718dc2d86e5e0187d9a297722b1e5ea
Author: plusvic <plusvic at gmail.com>
Date:   Tue Feb 23 20:26:16 2016 +0100

    Fix warning
---
 libyara/modules/pe.c | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/libyara/modules/pe.c b/libyara/modules/pe.c
index c32fc47..88961a2 100644
--- a/libyara/modules/pe.c
+++ b/libyara/modules/pe.c
@@ -1907,19 +1907,18 @@ static uint64_t rich_internal(
     uint64_t version,
     uint64_t toolid)
 {
-    size_t rich_len;
+    int64_t rich_length;
+    int64_t rich_count;
+    int64_t i;
 
     PRICH_SIGNATURE clear_rich_signature;
     SIZED_STRING* rich_string;
 
-    int rich_signature_count;
-    int i;
-
     // Check if the required fields are set
     if (is_undefined(module, "rich_signature.length"))
         return UNDEFINED;
 
-    rich_len = get_integer(module, "rich_signature.length");
+    rich_length = get_integer(module, "rich_signature.length");
     rich_string = get_string(module, "rich_signature.clear_data");
 
     // If the clear_data was not set, return UNDEFINED
@@ -1933,15 +1932,15 @@ static uint64_t rich_internal(
 
     // Loop over the versions in the rich signature
 
-    rich_signature_count = \
-        (rich_len - sizeof(RICH_SIGNATURE)) / sizeof(RICH_VERSION_INFO);
+    rich_count = \
+        (rich_length - sizeof(RICH_SIGNATURE)) / sizeof(RICH_VERSION_INFO);
 
-    for (i = 0; i < rich_signature_count; i++)
+    for (i = 0; i < rich_count; i++)
     {
         DWORD id_version = clear_rich_signature->versions[i].id_version;
 
-        int match_version = version == RICH_VERSION_VERSION(id_version);
-        int match_toolid = toolid == RICH_VERSION_ID(id_version);
+        int match_version = (version == RICH_VERSION_VERSION(id_version));
+        int match_toolid = (toolid == RICH_VERSION_ID(id_version));
 
         if (version != UNDEFINED && toolid != UNDEFINED)
         {

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