From 45445f2087521a7509d48be3bb8436149f5ee391 Mon Sep 17 00:00:00 2001 From: Michael Ortmann <41313082+michaelortmann@users.noreply.github.com> Date: Sun, 1 Oct 2023 17:06:55 +0200 Subject: [PATCH] Fix strcpy-param-overlap Found by: michaelortmann Patch by: michaelortmann --- src/misc.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/misc.c b/src/misc.c index 64543cc51..8c54f9c5a 100644 --- a/src/misc.c +++ b/src/misc.c @@ -232,11 +232,7 @@ void splitcn(char *first, char *rest, char divider, size_t max) if (first != NULL) strlcpy(first, rest, max); if (first != rest) - /* In most circumstances, strcpy with src and dst being the same buffer - * can produce undefined results. We're safe here, as the src is - * guaranteed to be at least 2 bytes higher in memory than dest. - */ - strcpy(rest, p + 1); + memmove(rest, p + 1, strlen(p + 1) + 1); } char *splitnick(char **blah)