From jwk@stack.nl  Wed Mar 20 10:52:34 2002
Return-Path: <jwk@stack.nl>
Received: from mailhost.stack.nl (vaak.stack.nl [131.155.140.140])
	by hub.freebsd.org (Postfix) with ESMTP id 2B6C037B416
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 20 Mar 2002 10:52:33 -0800 (PST)
Received: from turtle.stack.nl (turtle.stack.nl [2001:610:1108:5010:202:b3ff:fe17:a070])
	by mailhost.stack.nl (Postfix) with ESMTP id C9A9A3D832
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 20 Mar 2002 19:52:31 +0100 (CET)
Received: by turtle.stack.nl (Postfix, from userid 887)
	id 6D9CBC0; Wed, 20 Mar 2002 19:52:31 +0100 (CET)
Message-Id: <20020320185231.6D9CBC0@turtle.stack.nl>
Date: Wed, 20 Mar 2002 19:52:31 +0100 (CET)
From: Jan Willem Knopper <jwk@stack.nl>
Reply-To: Jan Willem Knopper <jwk@stack.nl>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: sh dumps core
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         36141
>Category:       bin
>Synopsis:       sh dumps core
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    greid
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Mar 20 11:00:03 PST 2002
>Closed-Date:    Mon Apr 22 01:12:41 PDT 2002
>Last-Modified:  Mon Apr 22 01:12:41 PDT 2002
>Originator:     Jan Willem Knopper
>Release:        FreeBSD 4.5-STABLE i386
>Organization:
M.C.G.V. Stack
>Environment:
System: FreeBSD turtle.stack.nl 4.5-STABLE FreeBSD 4.5-STABLE #0: Wed Feb 6 21:49:20 CET 2002 marcolz@toad.stack.nl:/toad.mnt/sources/4.x/sys/compile/snail_turtle i386


>Description:
	sh coredumps when the builtin function hash is invocated with
	option -v and as an argument a full path (i.e. hash -v /bin/sh)
>How-To-Repeat:
	sh
	hash -v /bin/sh


>Fix:
>Release-Note:
>Audit-Trail:

From: George Reid <greid@FreeBSD.org>
To: Jan Willem Knopper <jwk@stack.nl>
Cc: FreeBSD-gnats-submit@FreeBSD.org
Subject: Re: bin/36141: sh dumps core
Date: Wed, 20 Mar 2002 20:56:44 +0000

 On Wed, Mar 20, 2002 at 07:52:31PM +0100, Jan Willem Knopper wrote:
 
 > >Description:
 > 	sh coredumps when the builtin function hash is invocated with
 > 	option -v and as an argument a full path (i.e. hash -v /bin/sh)
 
 Please try the included patch.  Should apply to CURRENT or STABLE.
 
 Does sh have a MAINTAINER?
 
 Index: exec.c
 ===================================================================
 RCS file: /usr/home/ncvs/src/bin/sh/exec.c,v
 retrieving revision 1.16
 diff -u -r1.16 exec.c
 --- exec.c	2 Feb 2002 06:50:46 -0000	1.16
 +++ exec.c	20 Mar 2002 20:53:10 -0000
 @@ -350,7 +350,10 @@
  		if (verbose) {
  			if (entry.cmdtype != CMDUNKNOWN) {	/* if no error msg */
  				cmdp = cmdlookup(name, 0);
 -				printentry(cmdp, verbose);
 +				if (cmdp != NULL)
 +					printentry(cmdp, verbose);
 +				else
 +					outfmt(&errout, "%s: not found\n", name);
  			}
  			flushall();
  		}
 
 -- 
 George C A Reid			        Tel: (08701) 200870  Ext. 26654
 WWW: http://people.FreeBSD.org/~greid/  Mob: (07740) 197460
 FreeBSD Committer/Developer             greid@FreeBSD.org
 Oriel College, Oxford University        george.reid@oriel.ox.ac.uk
State-Changed-From-To: open->patched 
State-Changed-By: greid 
State-Changed-When: Mon Apr 15 08:49:37 PDT 2002 
State-Changed-Why:  
Fixed in r1.17 (current) 


Responsible-Changed-From-To: freebsd-bugs->greid 
Responsible-Changed-By: greid 
Responsible-Changed-When: Mon Apr 15 08:49:37 PDT 2002 
Responsible-Changed-Why:  
I'll MFC the fix. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=36141 
State-Changed-From-To: patched->closed 
State-Changed-By: greid 
State-Changed-When: Mon Apr 22 01:11:19 PDT 2002 
State-Changed-Why:  
MFC complete (src/bin/sh/exec.c r1.14.2.2) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=36141 
>Unformatted:
