From 7f206b679ba1a86cc09f34516ff9dd5dce6e1f60 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Mon, 4 Jan 2010 10:51:34 +0100 Subject: [PATCH] regcomp: recognize ill-formed { } expressions * lib/regcomp.c (parse_dup_op): From glibc: http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=a87cd2894cb --- ChangeLog | 4 ++++ lib/regcomp.c | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 5bdb76b4e..a3c71c03d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2010-01-04 Jim Meyering + regcomp: recognize ill-formed { } expressions + * lib/regcomp.c (parse_dup_op): From glibc: + http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=a87cd2894cb + regcomp: fix typo in comment * lib/regcomp.c (duplicate_node_closure): Sync from glibc. s/satisfy/satisfies/. diff --git a/lib/regcomp.c b/lib/regcomp.c index ae75e1a9f..629f97142 100644 --- a/lib/regcomp.c +++ b/lib/regcomp.c @@ -2519,7 +2519,8 @@ parse_dup_op (bin_tree_t *elem, re_string_t *regexp, re_dfa_t *dfa, return elem; } - if (BE (end != REG_MISSING && start > end, 0)) + if (BE ((end != REG_MISSING && start > end) + || token->type != OP_CLOSE_DUP_NUM, 0)) { /* First number greater than second. */ *err = REG_BADBR; -- 2.11.0