about summary refs log tree commit diff
path: root/posix/regexec.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-09-23 05:33:43 +0000
committerUlrich Drepper <drepper@redhat.com>2003-09-23 05:33:43 +0000
commitce85933261d37a0cd5345687acc948fe5bfdabd0 (patch)
tree05c0cc43281b8575000f0e249b88bb944be22af0 /posix/regexec.c
parent571f2090f876fee3eb99fd141d6595e6bc45549c (diff)
downloadglibc-ce85933261d37a0cd5345687acc948fe5bfdabd0.tar.gz
glibc-ce85933261d37a0cd5345687acc948fe5bfdabd0.tar.xz
glibc-ce85933261d37a0cd5345687acc948fe5bfdabd0.zip
Upate.
2003-09-20  Paolo Bonzini  <bonzini@gnu.org>

	* posix/regcomp.c (peek_token): Don't look back for ( or |
	to check whether to treat a caret as special.  It fails
	for the (extended) regex \(^.
	(parse, parse_reg_exp): Pass RE_CARET_ANCHORS_HERE to fetch_token.
	* posix/regex.h: Define RE_CARET_ANCHORS_HERE.

	* posix/regexec.c: Check out of bounds value before shifting.

	* posix/regex_internal.h: Define __attribute for non-gcc.
Diffstat (limited to 'posix/regexec.c')
-rw-r--r--posix/regexec.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/posix/regexec.c b/posix/regexec.c
index 277c935231..39a27d2fed 100644
--- a/posix/regexec.c
+++ b/posix/regexec.c
@@ -2193,6 +2193,7 @@ check_subexp_matching_top (dfa, mctx, cur_nodes, str_idx)
     {
       int node = cur_nodes->elems[node_idx];
       if (dfa->nodes[node].type == OP_OPEN_SUBEXP
+	  && dfa->nodes[node].opr.idx < (8 * sizeof (dfa->used_bkref_map))
 	  && dfa->used_bkref_map & (1 << dfa->nodes[node].opr.idx))
 	{
 	  err = match_ctx_add_subtop (mctx, node, str_idx);