From a049fddcea10bc374ca9c90482e97c1e2a70c7f8 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Sat, 25 Apr 2026 23:28:40 +0200 Subject: [PATCH] Fix stray null write from sizeof(pointer) bug in var_subst() (#190) Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: welcor <357770+welcor@users.noreply.github.com> --- src/dg_variables.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dg_variables.c b/src/dg_variables.c index dd6b11a..5f7d7d4 100644 --- a/src/dg_variables.c +++ b/src/dg_variables.c @@ -1722,5 +1722,5 @@ void var_subst(void *go, struct script_data *sc, trig_data *trig, left -= len; } /* else if *p .. */ } /* while *p .. */ - buf[sizeof(buf) - 1] = '\0'; + *buf = '\0'; }