From 370bfe006d9f9fb87885c31f943d151013cd529f Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Sun, 16 Jan 2022 07:44:15 -0800 Subject: [PATCH] SCP: Avoid using strlcpy for overlapping string copy --- scp.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scp.c b/scp.c index 6d7a5548..8e493cd7 100644 --- a/scp.c +++ b/scp.c @@ -6504,8 +6504,10 @@ if (vdelt) { if (1) { char mode[] = S_xstr(SIM_VERSION_MODE); - if (NULL != strchr (mode, '\"')) /* Quoted String? */ - strlcpy (mode, mode + 1, strlen (mode) - 1);/* strip quotes */ + if (NULL != strchr (mode, '\"')) { /* Quoted String? */ + mode[strlen (mode) - 1] = '\0'; /* strip quotes */ + memmove (mode, mode + 1, strlen (mode)); + } fprintf (st, " %s", mode); setenv ("SIM_VERSION_MODE", mode, 1); }