[Forensics-changes] [yara] 49/160: Fix regression in pe_collect_resources().

Hilko Bengen bengen at moszumanska.debian.org
Sat Jul 1 10:29:17 UTC 2017


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

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

commit c53c083055222022dceb1a1cc15369f5d6726ff9
Author: Wesley Shields <wxs at atarininja.org>
Date:   Mon Mar 16 20:47:46 2015 -0400

    Fix regression in pe_collect_resources().
    
    It appears that after 223daaf9c4d335b87805654466fba32f3988ad5a no
    resources were properly collected. Fix it by passing in the correct
    offset, which is pe->data + offset.
---
 libyara/modules/pe.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libyara/modules/pe.c b/libyara/modules/pe.c
index b723e7f..1eb3069 100644
--- a/libyara/modules/pe.c
+++ b/libyara/modules/pe.c
@@ -707,7 +707,7 @@ int pe_collect_resources(
   DWORD length;
   size_t offset = pe_rva_to_offset(pe, rsrc_data->OffsetToData);
 
-  if (offset == 0 || !fits_in_pe(pe, offset, rsrc_data->Size))
+  if (offset == 0 || !fits_in_pe(pe, pe->data + offset, rsrc_data->Size))
     return RESOURCE_CALLBACK_CONTINUE;
 
   set_integer(

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