summaryrefslogtreecommitdiffstats
path: root/bin/sh/parser.c
diff options
context:
space:
mode:
authorjilles <jilles@FreeBSD.org>2013-01-13 19:26:33 +0000
committerjilles <jilles@FreeBSD.org>2013-01-13 19:26:33 +0000
commitb479a582c314b537fc0c8e471a104bb84d9f9698 (patch)
tree289101361f287af8f559b92b67fa233539afef78 /bin/sh/parser.c
parent1af5c5cc5f617aaef7ab78705c5c70caea880cb1 (diff)
downloadFreeBSD-src-b479a582c314b537fc0c8e471a104bb84d9f9698.zip
FreeBSD-src-b479a582c314b537fc0c8e471a104bb84d9f9698.tar.gz
sh: Fix crash when parsing '{ } &'.
MFC after: 1 week
Diffstat (limited to 'bin/sh/parser.c')
-rw-r--r--bin/sh/parser.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/sh/parser.c b/bin/sh/parser.c
index a19ca31..665b53f 100644
--- a/bin/sh/parser.c
+++ b/bin/sh/parser.c
@@ -240,9 +240,9 @@ list(int nlflag, int erflag)
n2 = andor();
tok = readtoken();
if (tok == TBACKGND) {
- if (n2->type == NPIPE) {
+ if (n2 != NULL && n2->type == NPIPE) {
n2->npipe.backgnd = 1;
- } else if (n2->type == NREDIR) {
+ } else if (n2 != NULL && n2->type == NREDIR) {
n2->type = NBACKGND;
} else {
n3 = (union node *)stalloc(sizeof (struct nredir));
OpenPOWER on IntegriCloud