diff --git a/netkit-telnet-0.17-telnetrc.patch b/netkit-telnet-0.17-telnetrc.patch new file mode 100644 index 0000000..215a82b --- /dev/null +++ b/netkit-telnet-0.17-telnetrc.patch @@ -0,0 +1,19 @@ +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') diff --git a/telnet.spec b/telnet.spec index 8cd9bf6..d1dfb73 100644 --- a/telnet.spec +++ b/telnet.spec @@ -3,7 +3,7 @@ Summary: The client program for the Telnet remote login protocol Name: telnet Version: 0.17 -Release: 71%{?dist} +Release: 72%{?dist} Epoch: 1 License: BSD Group: Applications/Internet @@ -39,6 +39,7 @@ Patch27: telnet-0.17-force-ipv6-ipv4.patch Patch28: netkit-telnet-0.17-core-dump.patch Patch29: netkit-telnet-0.17-gcc7.patch Patch30: netkit-telnet-0.17-manpage.patch +Patch31: netkit-telnet-0.17-telnetrc.patch BuildRequires: ncurses-devel systemd BuildRequires: perl-interpreter @@ -93,6 +94,7 @@ mv telnet telnet-NETKIT %patch28 -p1 -b .core-dump %patch29 -p1 -b .gcc7 %patch30 -p1 -b .manpage +%patch31 -p1 -b .telnetrc %build %ifarch s390 s390x @@ -158,6 +160,9 @@ install -p -m644 %SOURCE6 ${RPM_BUILD_ROOT}%{_unitdir}/telnet.socket %{_mandir}/man8/telnetd.8* %changelog +* Mon Jul 23 2018 Michal Ruprich - 1:0.17-72 +- Resolves: #1505954 - telnet failing to parse .telnetrc due to strncpy used on overlaping buffers + * Thu Aug 03 2017 Fedora Release Engineering - 1:0.17-71 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild