summaryrefslogtreecommitdiffstats
path: root/usr.sbin/lpr
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2005-02-15 10:23:01 +0000
committerdelphij <delphij@FreeBSD.org>2005-02-15 10:23:01 +0000
commit91899c327734c289fe8cf6abad150c3537aefbd6 (patch)
tree67d80de48a80bdf79f8612e3452abf7c8b9befa2 /usr.sbin/lpr
parent136924cea45cc799b4b1febb17cd957209a402dc (diff)
downloadFreeBSD-src-91899c327734c289fe8cf6abad150c3537aefbd6.zip
FreeBSD-src-91899c327734c289fe8cf6abad150c3537aefbd6.tar.gz
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
Diffstat (limited to 'usr.sbin/lpr')
-rw-r--r--usr.sbin/lpr/lpc/lpc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.sbin/lpr/lpc/lpc.c b/usr.sbin/lpr/lpc/lpc.c
index e58911c..9d237eb 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]);
OpenPOWER on IntegriCloud