aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim J. Robbins <tjr@FreeBSD.org>2002-10-06 06:35:51 +0000
committerTim J. Robbins <tjr@FreeBSD.org>2002-10-06 06:35:51 +0000
commit427748f7df4c95b955328061873a0716a0643b0b (patch)
treee14d23a8dc39e8999f9cb0b4b2bdb1dc7f1b5480
parent82f520853b9b1a81abb83db4fb438ab13192b648 (diff)
Notes
-rw-r--r--bin/sh/parser.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/bin/sh/parser.c b/bin/sh/parser.c
index 4df742d34162..e00df92aab86 100644
--- a/bin/sh/parser.c
+++ b/bin/sh/parser.c
@@ -323,7 +323,8 @@ command(void)
case TIF:
n1 = (union node *)stalloc(sizeof (struct nif));
n1->type = NIF;
- n1->nif.test = list(0);
+ if ((n1->nif.test = list(0)) == NULL)
+ synexpect(-1);
if (readtoken() != TTHEN)
synexpect(TTHEN);
n1->nif.ifpart = list(0);
@@ -332,7 +333,8 @@ command(void)
n2->nif.elsepart = (union node *)stalloc(sizeof (struct nif));
n2 = n2->nif.elsepart;
n2->type = NIF;
- n2->nif.test = list(0);
+ if ((n2->nif.test = list(0)) == NULL)
+ synexpect(-1);
if (readtoken() != TTHEN)
synexpect(TTHEN);
n2->nif.ifpart = list(0);
@@ -352,7 +354,8 @@ command(void)
int got;
n1 = (union node *)stalloc(sizeof (struct nbinary));
n1->type = (lasttoken == TWHILE)? NWHILE : NUNTIL;
- n1->nbinary.ch1 = list(0);
+ if ((n1->nbinary.ch1 = list(0)) == NULL)
+ synexpect(-1);
if ((got=readtoken()) != TDO) {
TRACE(("expecting DO got %s %s\n", tokname[got], got == TWORD ? wordtext : ""));
synexpect(TDO);