[Forensics-changes] [yara] 264/407: Fix segfaults in PE module

Hilko Bengen bengen at moszumanska.debian.org
Sat Jul 1 10:28:33 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 82a4212918bed6f6610122992769cc1d5ed7101f
Author: Victor M. Alvarez <plusvic at gmail.com>
Date:   Mon Dec 29 13:20:21 2014 +0100

    Fix segfaults in PE module
---
 libyara/modules/pe.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libyara/modules/pe.c b/libyara/modules/pe.c
index d607814..bbcf501 100644
--- a/libyara/modules/pe.c
+++ b/libyara/modules/pe.c
@@ -554,7 +554,8 @@ int pe_find_version_info_cb(
             string_table,
             string_table->Length);
 
-        while (string < string_table)
+        while (struct_fits_in_pe(pe, string, VERSION_INFO) &&
+               string < string_table)
         {
           char* string_value = (char*) ADD_OFFSET(
               string,
@@ -571,7 +572,8 @@ int pe_find_version_info_cb(
           string = ADD_OFFSET(string, string->Length);
         }
 
-        if (string_table->Length == 0)
+        if (!struct_fits_in_pe(pe, string_table, VERSION_INFO) ||
+            string_table->Length == 0)
           break;
       }
     }

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