From 67c9cc96570378b44561bfae6b7a755dcc15a888 Mon Sep 17 00:00:00 2001 From: ManDude Date: Sun, 27 Oct 2019 20:01:42 +0000 Subject: [PATCH] thecl: Fix inline sub crash if new label name is too large --- thecl/ecsparse.y | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/thecl/ecsparse.y b/thecl/ecsparse.y index 30a46bf9..b78cdb48 100644 --- a/thecl/ecsparse.y +++ b/thecl/ecsparse.y @@ -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);