Skip to content

Commit

Permalink
thecl: Fix inline sub crash if new label name is too large
Browse files Browse the repository at this point in the history
  • Loading branch information
ManDude committed Oct 27, 2019
1 parent a25ccf8 commit 67c9cc9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion thecl/ecsparse.y
Original file line number Diff line number Diff line change
Expand Up @@ -1747,7 +1747,7 @@ static void instr_create_inline_call(
thecl_label_t* label;
list_for_each(&sub->labels, label) {
snprintf(buf, 256, "%s%s", name, label->name);
thecl_label_t* new_label = malloc(sizeof(new_label) + strlen(buf) + 1);
thecl_label_t* new_label = malloc(sizeof(thecl_label_t) + strlen(buf) + 1);
new_label->offset = label->offset + state->current_sub->offset;
new_label->time = label->time + state->instr_time;
strcpy(new_label->name, buf);
Expand Down

0 comments on commit 67c9cc9

Please sign in to comment.