summaryrefslogtreecommitdiff
path: root/lib/libc/regex
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2020-12-28 21:41:56 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2020-12-28 21:41:56 +0000
commit49fa3e9f2bfe1fe8be61d48565877af690263ae1 (patch)
tree841ab9a4d2ba2f8d7daf905f7c77e12eb881d74f /lib/libc/regex
parent1b62530488e4386a26357e0c221a715d72ffd4df (diff)
Fix an off-by-one error in the marking of the O_CH operator following
an OOR2 operator. Also includes a regress test for the issue. From FreeBSD via miod@
Diffstat (limited to 'lib/libc/regex')
-rw-r--r--lib/libc/regex/engine.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/regex/engine.c b/lib/libc/regex/engine.c
index 9d3ca24a800..62da73f99fe 100644
--- a/lib/libc/regex/engine.c
+++ b/lib/libc/regex/engine.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: engine.c,v 1.25 2018/07/11 12:38:46 martijn Exp $ */
+/* $OpenBSD: engine.c,v 1.26 2020/12/28 21:41:55 millert Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994 Henry Spencer.
@@ -935,7 +935,7 @@ step(struct re_guts *g,
OP(s = g->strip[pc+look]) != O_CH;
look += OPND(s))
assert(OP(s) == OOR2);
- FWD(aft, aft, look);
+ FWD(aft, aft, look + 1);
}
break;
case OOR2: /* propagate OCH_'s marking */