Recognize ill-formed { } expressions in regcomp.
authorUlrich Drepper <drepper@redhat.com>
Sun, 23 Aug 2009 22:22:00 +0000 (15:22 -0700)
committerUlrich Drepper <drepper@redhat.com>
Sun, 23 Aug 2009 22:22:00 +0000 (15:22 -0700)
ChangeLog
posix/regcomp.c

index a42e20b..37cd868 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2009-08-23  Ulrich Drepper  <drepper@redhat.com>
 
+       * posix/regcomp.c (parse_dup_op): Verify the expression is correctly
+       terminated.
+
        * posix/unistd.h: Define _POSIX_VERSION and _POSIX2_* correctly if
        older POSIX versions are selected.
 
index 4843cfe..446fed5 100644 (file)
@@ -2481,7 +2481,7 @@ parse_dup_op (bin_tree_t *elem, re_string_t *regexp, re_dfa_t *dfa,
          return elem;
        }
 
-      if (BE (end != -1 && start > end, 0))
+      if (BE ((end != -1 && start > end) || token->type != OP_CLOSE_DUP_NUM, 0))
        {
          /* First number greater than second.  */
          *err = REG_BADBR;