Bug 858 - sh dumps core on uninitialized memory in editline
Summary: sh dumps core on uninitialized memory in editline
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: Unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 1995-12-01 08:50 UTC by john hood
Modified: 1995-12-02 09:46 UTC (History)
0 users

See Also:


Attachments
file.diff (558 bytes, patch)
1995-12-01 08:50 UTC, john hood
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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