diff options
author | 2015-12-22 21:50:54 +0000 | |
---|---|---|
committer | 2015-12-22 21:50:54 +0000 | |
commit | 6c3a779b6fa225a47bb901b9a1572be44d689a88 (patch) | |
tree | cdb41015e4832e2bc11a251b2a035de6865985d3 | |
parent | fix sendmail options parsing (diff) | |
download | wireguard-openbsd-6c3a779b6fa225a47bb901b9a1572be44d689a88.tar.xz wireguard-openbsd-6c3a779b6fa225a47bb901b9a1572be44d689a88.zip |
in case we have a parse error, dispell the target list early to avoid
various problems.
Problem noticed by jsg@, deeper patch than he suggested
okay jsg@ and tb@.
-rw-r--r-- | usr.bin/make/parse.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/usr.bin/make/parse.c b/usr.bin/make/parse.c index 11d02df162a..47d124c19fc 100644 --- a/usr.bin/make/parse.c +++ b/usr.bin/make/parse.c @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.c,v 1.114 2015/11/29 09:17:12 espie Exp $ */ +/* $OpenBSD: parse.c,v 1.115 2015/12/22 21:50:54 espie Exp $ */ /* $NetBSD: parse.c,v 1.29 1997/03/10 21:20:04 christos Exp $ */ /* @@ -822,12 +822,18 @@ ParseDoDependency(const char *line) /* the line to parse */ Array_Reset(&gsources); cp = parse_do_targets(&paths, &tOp, line); - if (cp == NULL || specType == SPECIAL_ERROR) + if (cp == NULL || specType == SPECIAL_ERROR) { + /* invalidate targets for further processing */ + Array_Reset(>argets); return; + } op = parse_operator(&cp); - if (op == OP_ERROR) + if (op == OP_ERROR) { + /* invalidate targets for further processing */ + Array_Reset(>argets); return; + } Array_FindP(>argets, ParseDoOp, op); dedup_targets(>argets); |