From owner-freebsd-bugs Sun Jul 19 12:11:28 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id MAA09752 for freebsd-bugs-outgoing; Sun, 19 Jul 1998 12:11:28 -0700 (PDT) (envelope-from owner-freebsd-bugs@FreeBSD.ORG) Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id MAA09739 for ; Sun, 19 Jul 1998 12:11:27 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.8.8/8.8.5) id MAA04565; Sun, 19 Jul 1998 12:10:01 -0700 (PDT) Received: (from nobody@localhost) by hub.freebsd.org (8.8.8/8.8.8) id MAA08905; Sun, 19 Jul 1998 12:02:35 -0700 (PDT) (envelope-from nobody) Message-Id: <199807191902.MAA08905@hub.freebsd.org> Date: Sun, 19 Jul 1998 12:02:35 -0700 (PDT) From: Anders.X.Thulin@telia.se To: freebsd-gnats-submit@FreeBSD.ORG X-Send-Pr-Version: www-1.0 Subject: bin/7320: init:single_user(): address of auto passed outside block Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 7320 >Category: bin >Synopsis: init:single_user(): address of auto passed outside block >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Jul 19 12:10:00 PDT 1998 >Last-Modified: >Originator: Anders Thulin >Organization: (none) >Release: 2.2.6 (Walnut Creek CD) >Environment: FreeBSD myname.my.domain 2.2.6-RELEASE FreeBSD 2.2.6-RELEASE #0: Wed Mar 25 02:28:49 GMT 1998 jkh@time.cdrom.com:/usr/src/sys/compile/GENERIC i386 >Description: Source: /usr/src/sbin/init/init.c, line 646. The address of the auto variable altshell is passed outside the block it has been defined in. Clearly dangerous practice. The assignment occurs in line 646 of init.d, and altshell is defined only a few lines higher up. >How-To-Repeat: Not applicable. I found the problem while linting the code. >Fix: Making altshell static is probably the quickest fix - and one so obvious that you hardly need my suggestion. But the type of problem suggest that the code may have been written hastily in the first place, so there may be more problems lurking. >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message