aboutsummaryrefslogtreecommitdiff
path: root/posix/regcomp.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-11-13 09:54:39 +0000
committerUlrich Drepper <drepper@redhat.com>2003-11-13 09:54:39 +0000
commitc34bfc8d37680f001ee1baa95ab9e0323adc5819 (patch)
treefed7021775649396e0d24ff728d13ba1296d76c3 /posix/regcomp.c
parentf6953f16bb49383a162560662778a377e4501039 (diff)
downloadglibc-c34bfc8d37680f001ee1baa95ab9e0323adc5819.tar
glibc-c34bfc8d37680f001ee1baa95ab9e0323adc5819.tar.gz
glibc-c34bfc8d37680f001ee1baa95ab9e0323adc5819.tar.bz2
glibc-c34bfc8d37680f001ee1baa95ab9e0323adc5819.zip
Update.
2003-11-13 Ulrich Drepper <drepper@redhat.com> * posix/regcomp.c (parse_expression): In BRE consecutive duplications are not allowed.
Diffstat (limited to 'posix/regcomp.c')
-rw-r--r--posix/regcomp.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/posix/regcomp.c b/posix/regcomp.c
index 531ec94f75..9a48aa3f3b 100644
--- a/posix/regcomp.c
+++ b/posix/regcomp.c
@@ -2233,6 +2233,14 @@ parse_expression (regexp, preg, token, syntax, nest, err)
tree = parse_dup_op (tree, regexp, dfa, token, syntax, err);
if (BE (*err != REG_NOERROR && tree == NULL, 0))
return NULL;
+ /* In BRE consecutive duplications are not allowed. */
+ if ((syntax & RE_CONTEXT_INVALID_DUP)
+ && (token->type == OP_DUP_ASTERISK
+ || token->type == OP_OPEN_DUP_NUM))
+ {
+ *err = REG_BADRPT;
+ return NULL;
+ }
dfa->has_plural_match = 1;
}