From owner-freebsd-bugs Sun Apr 6 21:40:20 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id VAA20907 for bugs-outgoing; Sun, 6 Apr 1997 21:40:20 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id VAA20856; Sun, 6 Apr 1997 21:40:10 -0700 (PDT) Resent-Date: Sun, 6 Apr 1997 21:40:10 -0700 (PDT) Resent-Message-Id: <199704070440.VAA20856@freefall.freebsd.org> Resent-From: gnats (GNATS Management) Resent-To: freebsd-bugs Resent-Reply-To: FreeBSD-gnats@freefall.FreeBSD.org, h-nokubi@nmit.mt.nec.co.jp Received: from who.cdrom.com (who.cdrom.com [204.216.27.3]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id VAA18232 for ; Sun, 6 Apr 1997 21:32:14 -0700 (PDT) Received: from TYO9.gate.nec.co.jp (TYO9.gate.nec.co.jp [203.180.98.35]) by who.cdrom.com (8.8.5/8.6.11) with ESMTP id RAA27466 for ; Sun, 6 Apr 1997 17:12:01 -0700 (PDT) Received: from mailsv.nec.co.jp ([133.200.254.203]) by TYO9.gate.nec.co.jp (8.8.5+2.7Wbeta5/3.4Wb-NEC-TYO9) with ESMTP id JAA20256 for ; Mon, 7 Apr 1997 09:11:59 +0900 (JST) Received: from ssse15.sss.abk.nec.co.jp (ssse15.sss.abk.nec.co.jp [133.206.64.65]) by mailsv.nec.co.jp (8.8.5+2.7Wbeta5/3.4W-97040118) with ESMTP id JAA22264 for ; Mon, 7 Apr 1997 09:11:58 +0900 (JST) Received: from sssfw.sss.abk.nec.co.jp (sssfw [133.206.64.1]) by ssse15.sss.abk.nec.co.jp (8.7.5+2.6Wbeta6/CF3.3W9-SSS_M950609) with ESMTP id JAA11120 for ; Mon, 7 Apr 1997 09:12:48 +0900 (JST) Received: by sssfw.sss.abk.nec.co.jp (8.7.5+2.6Wbeta6/3.4W2) id JAA04311 for ; Mon, 7 Apr 1997 09:12:05 +0900 (JST) Received: from p28.sss.abk.nec.co.jp by e2.sss.abk.nec.co.jp (8.7.6+2.6Wbeta7/3.3W9-NEC) id JAA08988; Mon, 7 Apr 1997 09:12:27 +0900 (JST) Received: (from h-nokubi@localhost) by p28.sss.abk.nec.co.jp (8.7.6/3.4W403/27/97) id JAA00580; Mon, 7 Apr 1997 09:05:51 +0900 (JST) Message-Id: <199704070005.JAA00580@p28.sss.abk.nec.co.jp> Date: Mon, 7 Apr 1997 09:05:51 +0900 (JST) From: h-nokubi@nmit.mt.nec.co.jp Reply-To: h-nokubi@nmit.mt.nec.co.jp To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: bin/3218: syscons causes segmentation fault by repeating cancel with ESC at FTP site setting Sender: owner-bugs@freebsd.org X-Loop: FreeBSD.org Precedence: bulk >Number: 3218 >Category: bin >Synopsis: syscons causes segmentation fault by repeating cancel with ESC at FTP site setting >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Apr 6 21:40:03 PDT 1997 >Last-Modified: >Originator: NOKUBI Hirotaka >Organization: NEC Microcomputer Technology Ltd., Tokyo, Japan >Release: FreeBSD 2.2.1-RELEASE i386 >Environment: FreeBSD fifthluna.nokubi.or.jp 2.2.1-RELEASE FreeBSD 2.2.1-RELEASE #1: Sat Apr 5 16:07:50 JST 1997 root@sassaby.nokubi.or.jp:/usr/src/.ports/2.2.1-RELEASE/sys/compile/HN2 i386 >Description: Cancel FTP site selection menu with ESC for a few times. Sysinstall cause segmentation fault. >How-To-Repeat: slightly complicated, sorry. Invoke sysinstall, then follow these sequences. 7, SPC, 5, SPC, 2, SPC, SPC, SPC, n, ESC, SPC, 2, SPC, 2, SPC , RET, SPC, n, , , SPC, 2, SPC, n, SPC, n, SPC, n, ESC, SPC, 2, SPC, SPC, SPC, n, ESC, SPC, 2, SPC, 2, SPC, , RET, SPC, n, ESC, SPC, 2, SPC, SPC, SPC, n, ESC, SPC, 2, SPC >Fix: variable_unset() frees next of the specified one. here is patch. --- variable.c Sat Apr 5 15:23:26 1997 +++ variable.c.corrected Sat Apr 5 15:03:03 1997 @@ -131,9 +131,9 @@ if (!strcmp(vp->name, var)) { Variable *save = vp->next; + safe_free(vp->name); + safe_free(vp->value); *vp = *save; - safe_free(save->name); - safe_free(save->value); safe_free(save); break; } I'm not sure, but following code is also something wrong. void variable_unset(char *var) { Variable *vp; char name[512], *cp; unsetenv(var); if ((cp = index(var, '=')) != NULL) { sstrncpy(name, cp, cp - var); var = string_skipwhite(string_prune(name)); } .... .... For example, `var' points the string: "site=ftp://ftp.freebsd.org/pub/FreeBSD/" above code copies "=ftp". How is it used? I can't understand it. >Audit-Trail: >Unformatted: