Module Name:    src
Committed By:   martin
Date:           Mon Aug 29 16:13:25 UTC 2022

Modified Files:
        src/libexec/telnetd [netbsd-9]: telnetd.c

Log Message:
Pull up following revision(s) (requested by dholland in ticket #1508):

        libexec/telnetd/telnetd.c: revision 1.58 (via patch)

telnetd: fix the crash that's been talked about the past couple days.

(Move initialization of the slc table earlier so it doesn't get
accessed before that happens.)

Calling the crash a DoS or security problem is a bit overwrought; it's
just a bug.


To generate a diff of this commit:
cvs rdiff -u -r1.55.28.1 -r1.55.28.2 src/libexec/telnetd/telnetd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/libexec/telnetd/telnetd.c
diff -u src/libexec/telnetd/telnetd.c:1.55.28.1 src/libexec/telnetd/telnetd.c:1.55.28.2
--- src/libexec/telnetd/telnetd.c:1.55.28.1	Fri Aug 16 19:12:46 2019
+++ src/libexec/telnetd/telnetd.c	Mon Aug 29 16:13:25 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: telnetd.c,v 1.55.28.1 2019/08/16 19:12:46 martin Exp $	*/
+/*	$NetBSD: telnetd.c,v 1.55.28.2 2022/08/29 16:13:25 martin Exp $	*/
 
 /*
  * Copyright (C) 1997 and 1998 WIDE Project.
@@ -65,7 +65,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 19
 #if 0
 static char sccsid[] = "@(#)telnetd.c	8.4 (Berkeley) 5/30/95";
 #else
-__RCSID("$NetBSD: telnetd.c,v 1.55.28.1 2019/08/16 19:12:46 martin Exp $");
+__RCSID("$NetBSD: telnetd.c,v 1.55.28.2 2022/08/29 16:13:25 martin Exp $");
 #endif
 #endif /* not lint */
 
@@ -678,6 +678,11 @@ doit(struct sockaddr *who)
 	char user_name[256];
 
 	/*
+	 * Initialize the slc mapping table.
+	 */
+	get_slc_defaults();
+
+	/*
 	 * Find an available pty to use.
 	 */
 	pty = getpty(&ptynum);
@@ -744,11 +749,6 @@ telnet(int f, int p)
 	struct pollfd set[2];
 
 	/*
-	 * Initialize the slc mapping table.
-	 */
-	get_slc_defaults();
-
-	/*
 	 * Do some tests where it is desireable to wait for a response.
 	 * Rather than doing them slowly, one at a time, do them all
 	 * at once.

Reply via email to