From a977d43fea135c3115ba330966ad31601d09a25d Mon Sep 17 00:00:00 2001 From: Sander Mertens Date: Sun, 15 Dec 2024 02:21:06 +0000 Subject: [PATCH] Fix access to uninitialized ecs_cmd_t::id field --- distr/flecs.c | 1 + src/stage.c | 1 + 2 files changed, 2 insertions(+) diff --git a/distr/flecs.c b/distr/flecs.c index a5975bc4f..5fffb6688 100644 --- a/distr/flecs.c +++ b/distr/flecs.c @@ -17290,6 +17290,7 @@ ecs_cmd_t* flecs_cmd_new( ecs_cmd_t *cmd = ecs_vec_append_t(&stage->allocator, &stage->cmd->queue, ecs_cmd_t); cmd->is._1.value = NULL; + cmd->id = 0; cmd->next_for_entity = 0; cmd->entry = NULL; cmd->system = stage->system; diff --git a/src/stage.c b/src/stage.c index f27f554a2..b4f97b460 100644 --- a/src/stage.c +++ b/src/stage.c @@ -24,6 +24,7 @@ ecs_cmd_t* flecs_cmd_new( ecs_cmd_t *cmd = ecs_vec_append_t(&stage->allocator, &stage->cmd->queue, ecs_cmd_t); cmd->is._1.value = NULL; + cmd->id = 0; cmd->next_for_entity = 0; cmd->entry = NULL; cmd->system = stage->system;