telnet/netkit-telnet-0.17-telnetrc.patch
Troy Dawson a36e3113ae RHEL 9.0.0 Alpha bootstrap
The content of this branch was automatically imported from Fedora ELN
with the following as its source:
https://src.fedoraproject.org/rpms/telnet#7fe48cbcb5d5c5594e848a95b4884cf0c09360eb
2020-10-15 10:26:56 -07:00

20 lines
734 B
Diff

diff --git a/telnet/commands.c b/telnet/commands.c
index 636fb5c..c0cc9b9 100644
--- a/telnet/commands.c
+++ b/telnet/commands.c
@@ -2217,11 +2217,11 @@ cmdrc(char *m1, char *m2)
if (isspace(line[0]))
continue;
if (strncasecmp(line, m1, l1) == 0)
- strncpy(line, &line[l1], sizeof(line) - l1);
+ memmove(line, &line[l1], sizeof(line) - l1);
else if (strncasecmp(line, m2, l2) == 0)
- strncpy(line, &line[l2], sizeof(line) - l2);
+ memmove(line, &line[l2], sizeof(line) - l2);
else if (strncasecmp(line, "DEFAULT", 7) == 0)
- strncpy(line, &line[7], sizeof(line) - 7);
+ memmove(line, &line[7], sizeof(line) - 7);
else
continue;
if (line[0] != ' ' && line[0] != '\t' && line[0] != '\n')