From 9d971ccd72b6a96626525921bf8e9c1ab52209ae Mon Sep 17 00:00:00 2001 From: Michael Ortmann <41313082+michaelortmann@users.noreply.github.com> Date: Sun, 12 Jan 2025 20:29:41 +0100 Subject: [PATCH] strncpy() + manual NULL terminating -> strlcpy() --- src/botnet.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/botnet.c b/src/botnet.c index bb6b4aad3..197992a2e 100644 --- a/src/botnet.c +++ b/src/botnet.c @@ -88,8 +88,7 @@ void addbot(char *who, char *from, char *next, char flag, int vernum, int ssl) ptr = &((*ptr)->next); } ptr2 = nmalloc(sizeof(tand_t)); - strncpy(ptr2->bot, who, HANDLEN); - ptr2->bot[HANDLEN] = 0; + strlcpy(ptr2->bot, who, sizeof ptr2->bot); ptr2->share = flag; ptr2->ver = vernum; ptr2->next = *ptr;