From d5c688188b34b296ee4f8c1a1b860fd465589dab Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 25 Apr 2026 14:44:04 +0000 Subject: [PATCH] Fix stray null write: replace sizeof(buf) with *buf = '\0' in var_subst() Agent-Logs-Url: https://github.com/tbamud/tbamud/sessions/339cbdde-5de4-4f33-aea6-82df3efbd9c4 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'; }