From deeb4aae693e746cec733826c2b90d9214a27dd9 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Thu, 13 Nov 2003 17:25:46 +0000 Subject: [PATCH] (parse_dup_op): Fail with REG_BADBR is first number in {,} expression is larger. --- posix/regcomp.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/posix/regcomp.c b/posix/regcomp.c index 9a48aa3f3b..0dee2e62fc 100644 --- a/posix/regcomp.c +++ b/posix/regcomp.c @@ -2412,6 +2412,12 @@ parse_dup_op (dup_elem, regexp, dfa, token, syntax, err) goto parse_dup_op_espace; } } + else if (BE (start > end, 0)) + { + /* First number greater than first. */ + *err = REG_BADBR; + return NULL; + } else if (end - start > 0) { /* Then extract "{0,m}" to "??...?". */