NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bin/38589: Piping editline commands to ftp causes it to segfault



>Number:         38589
>Category:       bin
>Synopsis:       Piping editline commands to ftp causes it to segfault
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon May 05 19:45:00 +0000 2008
>Originator:     Bruce Cran
>Release:        4.0
>Organization:
>Environment:
NetBSD 4.0 NetBSD 4.0 (GENERIC) #0: Sun Dec 16 00:20:10 PST 2007 
builds@wb34:/home/builds/ab/netbsd-4-0-RELEASE/i386/200712160005Z-obj/home/builds/ab/netbsd-4-0-RELEASE/src/sys/arch/i386/compile/GENERIC
 i386
>Description:
ftp only expects to be given editline commands through an interactive terminal. 
It segfaults if one is piped in e.g

echo bind | ftp

The problem occurs because editline is only intialized if an interactive
tty is being used. Otherwise, the controlediting function in util.c
skips all the intializing calls. However, later on cmdscanner is called
which attempts to run el_parse on unknown commands. 'el' is NULL and
causes a segfault when it's dereferenced in the map_bind function in the 
editline library.
>How-To-Repeat:
echo bind | ftp
>Fix:
Only call el_parse if 'editing' is 1 or if 'el' isn't NULL?



Home | Main Index | Thread Index | Old Index