Skip to content

Commit

Permalink
Merge branch 'master' into 3.6
Browse files Browse the repository at this point in the history
  • Loading branch information
plusvic committed Jun 5, 2017
2 parents a475171 + 11ffa88 commit 0d41b8f
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions libyara/parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,10 @@ int yr_parser_emit_with_arg_reloc(
int64_t* ptr = NULL;
int result;

DECLARE_REFERENCE(void*, argument) a;
a.argument = argument;
DECLARE_REFERENCE(void*, ptr) arg;

memset(&arg, 0, sizeof(arg));
arg.ptr = argument;

result = yr_arena_write_data(
yyget_extra(yyscanner)->code_arena,
Expand All @@ -130,8 +132,8 @@ int yr_parser_emit_with_arg_reloc(
if (result == ERROR_SUCCESS)
result = yr_arena_write_data(
yyget_extra(yyscanner)->code_arena,
&a,
sizeof(int64_t),
&arg,
sizeof(arg),
(void**) &ptr);

if (result == ERROR_SUCCESS)
Expand All @@ -142,7 +144,7 @@ int yr_parser_emit_with_arg_reloc(
EOL);

if (argument_address != NULL)
*argument_address = (void*)ptr;
*argument_address = (void*) ptr;

return result;
}
Expand Down

0 comments on commit 0d41b8f

Please sign in to comment.