From be8de64cf86754da86e61f40d491adac08b180c0 Mon Sep 17 00:00:00 2001 From: Thomas Arp <357770+welcor@users.noreply.github.com> Date: Wed, 19 Feb 2025 21:18:39 +0100 Subject: [PATCH] fix buffer overrun act.informative.c (#146) Ref https://www.tbamud.com/kunena/4-development/5636-bug-in-do-toggle-in-act-informative-c#10540 Thanks to Ironfist for the fix --- src/act.informative.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/act.informative.c b/src/act.informative.c index 5298e1c..a44ba72 100644 --- a/src/act.informative.c +++ b/src/act.informative.c @@ -1950,7 +1950,8 @@ ACMD(do_toggle) if (!GET_WIMP_LEV(ch)) strcpy(buf2, "OFF"); /* strcpy: OK */ else - sprintf(buf2, "%-3.3d", GET_WIMP_LEV(ch)); /* sprintf: OK */ + snprintf(buf2, sizeof(buf2), "%-3.3d", GET_WIMP_LEV(ch)); /* thanks to Ironfist for the fix for the buffer overrun here */ + if (GET_LEVEL(ch) == LVL_IMPL) { send_to_char(ch,