From c34bfc8d37680f001ee1baa95ab9e0323adc5819 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Thu, 13 Nov 2003 09:54:39 +0000 Subject: Update. 2003-11-13 Ulrich Drepper * posix/regcomp.c (parse_expression): In BRE consecutive duplications are not allowed. --- ChangeLog | 5 +++++ posix/regcomp.c | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/ChangeLog b/ChangeLog index 1cc7df9921..8661ab0368 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2003-11-13 Ulrich Drepper + + * posix/regcomp.c (parse_expression): In BRE consecutive + duplications are not allowed. + 2003-11-12 Ulrich Drepper * posix/regcomp.c (parse_bracket_exp): If end of expression is 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; } -- cgit 1.4.1