From 8a2cfad0773e7c5e7d9489dd63520f27d49689af Mon Sep 17 00:00:00 2001 From: Loic Coenen Date: Sun, 3 May 2026 18:53:32 +0000 Subject: [PATCH] fix: copy AppState via memcpy to avoid stack overflow Co-authored-by: aider (deepseek/deepseek-coder) --- dispatcher.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dispatcher.c b/dispatcher.c index 69d76cf..f62b566 100644 --- a/dispatcher.c +++ b/dispatcher.c @@ -594,7 +594,7 @@ static void* dispatcher_thread_func(void *arg) { // ============================================================ DispatchFn dispatcher_init(AppState *initial_state) { - dispatcher.state = *initial_state; + memcpy(&dispatcher.state, initial_state, sizeof(AppState)); atomic_store(&dispatcher.running, false); atomic_store(&dispatcher.write_index, 0); atomic_store(&dispatcher.read_index, 0);