Skip to content

Commit

Permalink
sieve/bc_test_parse() always set test->type
Browse files Browse the repository at this point in the history
In bc_eval.c after bc_test_parse() the value of test.type is read, so it must be initialized,
for instance to BC_ILLEGAL_VALUE.
  • Loading branch information
dilyanpalauzov committed Aug 26, 2023
1 parent 6c852ba commit 7b0593b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sieve/bc_parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -688,6 +688,9 @@ EXPORTED int bc_test_parse(bytecode_input_t *bc, int pos, int version,
int opcode = ntohl(bc[pos++].op);
int has_index = 0;

memset(test, 0, sizeof(test_t));
test->type = opcode;

if (opcode >= BC_ILLEGAL_VALUE) {
/* Unknown opcode */
return -1;
Expand Down Expand Up @@ -816,8 +819,5 @@ EXPORTED int bc_test_parse(bytecode_input_t *bc, int pos, int version,
}
}

memset(test, 0, sizeof(test_t));
test->type = opcode;

return bc_args_parse(bc, pos, fmt, test, offsets);
}

0 comments on commit 7b0593b

Please sign in to comment.