diff options
author | 2017-01-25 14:17:45 +0000 | |
---|---|---|
committer | 2017-01-25 14:17:45 +0000 | |
commit | e4dd574c631878ef17018f50fd31aad39a356b25 (patch) | |
tree | 1d197f7e38a4bbc0abb3bdb77c124a3a45820d97 | |
parent | if the fs got badly damaged, display a decent error message instead of (diff) | |
download | wireguard-openbsd-e4dd574c631878ef17018f50fd31aad39a356b25.tar.xz wireguard-openbsd-e4dd574c631878ef17018f50fd31aad39a356b25.zip |
off-by-one, leading to segfaults. Trivial fix.
reported by jasper@
-rw-r--r-- | usr.bin/make/varmodifiers.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/make/varmodifiers.c b/usr.bin/make/varmodifiers.c index c8f8b99bc72..2087a41674b 100644 --- a/usr.bin/make/varmodifiers.c +++ b/usr.bin/make/varmodifiers.c @@ -1,4 +1,4 @@ -/* $OpenBSD: varmodifiers.c,v 1.44 2016/10/02 17:42:31 tb Exp $ */ +/* $OpenBSD: varmodifiers.c,v 1.45 2017/01/25 14:17:45 espie Exp $ */ /* $NetBSD: var.c,v 1.18 1997/03/18 19:24:46 christos Exp $ */ /* @@ -876,7 +876,7 @@ VarRESubstitute(struct Name *word, bool addSpace, Buffer buf, void *patternp) rp++; } - if (n > pat->nsub) { + if (n >= pat->nsub) { Error("No subexpression %s", &errstr[0]); subbuf = ""; |