regcomp: recognize ill-formed { } expressions
authorUlrich Drepper <drepper@redhat.com>
Mon, 4 Jan 2010 09:51:34 +0000 (10:51 +0100)
committerJim Meyering <meyering@redhat.com>
Mon, 4 Jan 2010 15:22:15 +0000 (16:22 +0100)
* lib/regcomp.c (parse_dup_op): From glibc:
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=a87cd2894cb

ChangeLog
lib/regcomp.c

index 5bdb76b4e66b6a2bc57d8703461e9a48c120779f..a3c71c03d6a89f0f7b6491611898ecb8f93184d0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2010-01-04  Jim Meyering  <meyering@redhat.com>
 
+       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/.
index ae75e1a9f13347970be34b8ff654811a1460624e..629f97142f6bd16ccd1ef7f6594cefc5741c871d 100644 (file)
@@ -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;