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
This commit is contained in:
Thomas Arp
2025-02-19 21:18:39 +01:00
committed by GitHub
parent 5024dd8e66
commit be8de64cf8

View File

@@ -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,