Resolves: #1606506 - telnet: FTBFS in Fedora rawhide

Resolves: #1505954 - telnet failing to parse .telnetrc due to strncpy used on overlaping buffers
This commit is contained in:
Michal Ruprich 2018-07-23 13:18:59 +02:00
parent 7c71d97df9
commit a88283db8c
2 changed files with 27 additions and 2 deletions

View File

@ -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')

View File

@ -3,7 +3,7 @@
Summary: The client program for the Telnet remote login protocol
Name: telnet
Version: 0.17
Release: 73%{?dist}
Release: 74%{?dist}
Epoch: 1
License: BSD
Group: Applications/Internet
@ -39,8 +39,9 @@ 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: ncurses-devel systemd gcc gcc-c++
BuildRequires: perl-interpreter
%description
@ -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
@ -157,6 +159,10 @@ install -p -m644 %SOURCE6 ${RPM_BUILD_ROOT}%{_unitdir}/telnet.socket
%{_mandir}/man8/telnetd.8*
%changelog
* Mon Jul 23 2018 Michal Ruprich <mruprich@redhat.com> - 1:0.17-74
- Resolves: #1606506 - telnet: FTBFS in Fedora rawhide
- Resolves: #1505954 - telnet failing to parse .telnetrc due to strncpy used on overlaping buffers
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1:0.17-73
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild