Hi. I maintain GNU InetUtils which contains a telnet implementation that share origins with BSD code, and I can reproduce the bug reports we got on FreeBSD 13.0 as follows. See discussions in https://lists.gnu.org/archive/html/bug-inetutils/2022-07/ with the fixes we adopted for these problems. It would be nice to coordinate patches and code syncs, if there is anyone in the FreeBSD community that is interested in working with us in the GNU InetUtils community! /Simon FreeBSD 13.0-RELEASE-p3 (GENERIC) #0: Tue Jun 29 19:46:20 UTC 2021 $ telnet telnet> set ' ' crash Segmentation fault (core dumped) $ telnet telnet> unset ' ' Segmentation fault (core dumped) $ telnet telnet> help help Segmentation fault (core dumped) $
The NetBSD folks used this patch: https://cvsweb.netbsd.org/bsdweb.cgi/src/usr.bin/telnet/commands.c.diff?r1=1.79&r2=1.80&only_with_tag=MAIN
Confirmed on 14-CURRENT.
Created attachment 235246 [details] NetBSD patch 1019940:4f248823eaff packaged for FreeBSD NetBSD uses Mercurial now. This would be commit 1019940:4f248823eaff. Can you apply this patch and test it, please. (Fix tested here.)
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=a7399ea2dd7810e76dcfd52248764cb8004d49a4 commit a7399ea2dd7810e76dcfd52248764cb8004d49a4 Author: Cy Schubert <cy@FreeBSD.org> AuthorDate: 2022-07-14 04:42:06 +0000 Commit: Cy Schubert <cy@FreeBSD.org> CommitDate: 2022-07-15 13:38:57 +0000 telnet: Fix telnet segfault when invalid set or help help commands Silently ignore invalid set ' ' and invalid help help commands. This is the same fix applied by NetBSD in hg commit 1019940:4f248823eaff. PR: 265097 Reported by: Simon Josefsson <simon@josefsson.org> Obtained from: NetBSD hg commit 1019940:4f248823eaff NetBSD PR/56918 MFC after: 1 week contrib/telnet/telnet/commands.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
A commit in branch stable/13 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=2bd84a3d19e7603bef56a4b5c2e18ff969df3ab6 commit 2bd84a3d19e7603bef56a4b5c2e18ff969df3ab6 Author: Cy Schubert <cy@FreeBSD.org> AuthorDate: 2022-07-14 04:42:06 +0000 Commit: Cy Schubert <cy@FreeBSD.org> CommitDate: 2022-07-22 13:03:03 +0000 telnet: Fix telnet segfault when invalid set or help help commands Silently ignore invalid set ' ' and invalid help help commands. This is the same fix applied by NetBSD in hg commit 1019940:4f248823eaff. PR: 265097 Reported by: Simon Josefsson <simon@josefsson.org> Obtained from: NetBSD hg commit 1019940:4f248823eaff NetBSD PR/56918 (cherry picked from commit a7399ea2dd7810e76dcfd52248764cb8004d49a4) contrib/telnet/telnet/commands.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
A commit in branch stable/12 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=eeadef8fd52388bb9345df0ef472e0e7feca4afa commit eeadef8fd52388bb9345df0ef472e0e7feca4afa Author: Cy Schubert <cy@FreeBSD.org> AuthorDate: 2022-07-14 04:42:06 +0000 Commit: Cy Schubert <cy@FreeBSD.org> CommitDate: 2022-07-22 13:04:07 +0000 telnet: Fix telnet segfault when invalid set or help help commands Silently ignore invalid set ' ' and invalid help help commands. This is the same fix applied by NetBSD in hg commit 1019940:4f248823eaff. PR: 265097 Reported by: Simon Josefsson <simon@josefsson.org> Obtained from: NetBSD hg commit 1019940:4f248823eaff NetBSD PR/56918 (cherry picked from commit a7399ea2dd7810e76dcfd52248764cb8004d49a4) contrib/telnet/telnet/commands.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
Fixed.