From c7cc259656cfbb938cd7d1c3eac95747959078b5 Mon Sep 17 00:00:00 2001 From: Xin LI Date: Tue, 15 Feb 2005 10:23:01 +0000 Subject: [PATCH] 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 PR: 77462 (patch rewritten by myself) MFC After: 1 week --- usr.sbin/lpr/lpc/lpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/lpr/lpc/lpc.c b/usr.sbin/lpr/lpc/lpc.c index e58911c0609..9d237ebf719 100644 --- a/usr.sbin/lpr/lpc/lpc.c +++ b/usr.sbin/lpr/lpc/lpc.c @@ -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]);