From b479a582c314b537fc0c8e471a104bb84d9f9698 Mon Sep 17 00:00:00 2001 From: jilles Date: Sun, 13 Jan 2013 19:26:33 +0000 Subject: sh: Fix crash when parsing '{ } &'. MFC after: 1 week --- bin/sh/parser.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bin') 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)); -- cgit v1.1