Bug 858

Summary: sh dumps core on uninitialized memory in editline
Product: Base System Reporter: john hood <cgull>
Component: binAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description john hood 1995-12-01 08:50:03 UTC
editline will dereference an uninitialized pointer under certain
circumstances.  the memory pointer in question only gets stomped by
certain malloc/free usage patterns, though, so this is apparently not
a common problem.

How-To-Repeat: 
------------------------------8<------------------------------
#!/bin/sh
DIR=/tmp

cd $DIR

cat > .profile <<\Bonk
#!/bin/sh
set -x
# 57 slashes ok, 58 kills something
//////////////////////////////////////////////////////////
set -o ignoreeof
set -o emacs  # sh core dumps on this command
echo "Made it!"
Bonk

ln -s /bin/sh ./-sh

HOME=$DIR

PATH=.:$PATH

-sh
------------------------------8<------------------------------
Comment 1 Peter Wemm freebsd_committer freebsd_triage 1995-12-02 09:44:36 UTC
State Changed
From-To: open->closed

Suggested fix applied in rev 1.7 of libedit/term.c