Skip to content

Commit

Permalink
Fix endianness issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
plusvic committed Apr 8, 2024
1 parent 6209630 commit 5317a2b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libyara/modules/pe/pe.c
Expand Up @@ -502,7 +502,8 @@ static int _pe_iterate_resources(

if (struct_fits_in_pe(pe, data_entry, IMAGE_RESOURCE_DATA_ENTRY))
{
if (data_entry->Size > 0 && data_entry->Size < pe->data_size)
if (yr_le32toh(data_entry->Size) > 0 &&
yr_le32toh(data_entry->Size) < pe->data_size)
{
if (callback(
data_entry,
Expand Down

0 comments on commit 5317a2b

Please sign in to comment.