Skip to content

Commit

Permalink
Fix bug in "dotnet" module. Use "counter" instead of "i" where required.
Browse files Browse the repository at this point in the history
  • Loading branch information
Victor Manuel Alvarez committed Jul 5, 2017
1 parent 964d6c0 commit f40c14c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions libyara/modules/dotnet.c
Original file line number Diff line number Diff line change
Expand Up @@ -1002,7 +1002,7 @@ void dotnet_parse_tilde_2(

if (name != NULL)
{
set_string(name, pe->object, "modulerefs[%i]", i);
set_string(name, pe->object, "modulerefs[%i]", counter);
counter++;
}

Expand Down Expand Up @@ -1276,17 +1276,17 @@ void dotnet_parse_tilde_2(

// Add 4 to skip the size.
set_integer(resource_base + resource_offset + 4,
pe->object, "resources[%i].offset", i);
pe->object, "resources[%i].offset", counter);

set_integer(resource_size,
pe->object, "resources[%i].length", i);
pe->object, "resources[%i].length", counter);

name = pe_get_dotnet_string(pe,
string_offset,
DOTNET_STRING_INDEX(manifestresource_table->Name));

if (name != NULL)
set_string(name, pe->object, "resources[%i].name", i);
set_string(name, pe->object, "resources[%i].name", counter);

row_ptr += row_size;
counter++;
Expand Down

0 comments on commit f40c14c

Please sign in to comment.