🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.bugs.4bsd
Article #1641

telnet dumps core

#1641
From: Bill Nowicki
Date: Wed, 20 Aug 1986 23:19
88 lines
3432 bytes
Description:
        The telnet program (both 4.2BSD and 4.3BSD versions) dumps
        core when run on machines that do not allow referencing a NULL 
        pointer.

Repeat-By:
        Run the "telnet" program, and type a space followed by return.
        Or type "conn" followed by two returns.  If you are on a machine
        that does not allow refencing NULL pointers, then you get a core 
        dump crash.

sun% telnet
telnet>                 [ typed space followed by return ]
Segmentation fault (core dumped)
sun% telnet
telnet> open
(to)                    [ typed return ]
Segmentation fault (core dumped)
sun%

Fix:
*** telnet.c.fixed      Wed Aug 20 12:35:14 1986
--- /arch/4.3/usr/src/ucb/telnet.c      Tue May 27 09:47:07 1986
***************
*** 2025,2031 ****
                makeargv();
                argc = margc;
                argv = margv;
-               if (argv[1]==NULL) return 0;
        }
        if (argc > 3) {
                printf("usage: %s host-name [port]\n", argv[0]);
--- 2025,2030 ----
***************
*** 2278,2286 ****
                                quit();
                        break;
                }
!               makeargv();
!               if (margv[0] == NULL)
                        break;
                c = getcmd(margv[0]);
                if (c == Ambiguous(struct cmd *)) {
                        printf("?Ambiguous command\n");
--- 2277,2285 ----
                                quit();
                        break;
                }
!               if (line[0] == 0)
                        break;
+               makeargv();
                c = getcmd(margv[0]);
                if (c == Ambiguous(struct cmd *)) {
                        printf("?Ambiguous command\n");
*** /arch/4.3/usr/src/ucb/telnet.c      Tue May 27 09:47:07 1986
--- telnet.c.fixed      Wed Aug 20 12:35:14 1986
***************
*** 2025,2030 ****
--- 2025,2031 ----
                makeargv();
                argc = margc;
                argv = margv;
+               if (argv[1]==NULL) return 0;
        }
        if (argc > 3) {
                printf("usage: %s host-name [port]\n", argv[0]);
***************
*** 2277,2285 ****
                                quit();
                        break;
                }
-               if (line[0] == 0)
-                       break;
                makeargv();
                c = getcmd(margv[0]);
                if (c == Ambiguous(struct cmd *)) {
                        printf("?Ambiguous command\n");
--- 2278,2286 ----
                                quit();
                        break;
                }
                makeargv();
+               if (margv[0] == NULL)
+                       break;
                c = getcmd(margv[0]);
                if (c == Ambiguous(struct cmd *)) {
                        printf("?Ambiguous command\n");
Technical Details
Message-ID: <6394@sun.uucp>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!lll-crg!lll-lcc!pyramid!decwrl!sun!nowicki

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!lll-crg!lll-lcc!pyramid!decwrl!sun!nowicki
From: nowicki@sun.uucp (Bill Nowicki)
Newsgroups: net.bugs.4bsd
Subject: telnet dumps core
Message-ID: <6394@sun.uucp>
Date: Wed, 20-Aug-86 19:19:13 EDT
Article-I.D.: sun.6394
Posted: Wed Aug 20 19:19:13 1986
Date-Received: Thu, 21-Aug-86 04:42:55 EDT
Distribution: net
Organization: Sun Microsystems, Inc.
Lines: 87
Index:  src/ucb/telnet.c