Be more careful when doing el_parse() - only do it when el is

properly initialized, that happens when lpc is called from a tty.
Without this change, it's possible to get SIGSEGV simply doing:
	echo "..:" | lpc

Reported by:	Wojciech A. Koszek <dunstan at freebsd czest pl>
PR:		77462 (patch rewritten by myself)
MFC After:	1 week
This commit is contained in:
Xin LI 2005-02-15 10:23:01 +00:00
parent 423ac68026
commit c7cc259656
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=141947

View File

@ -201,7 +201,7 @@ cmdscanner(void)
makeargv();
if (margc == 0)
continue;
if (el_parse(el, margc, margv) != -1)
if (el!= NULL && el_parse(el, margc, margv) != -1)
continue;
c = getcmd(margv[0]);