Skip to content

Commit

Permalink
Recognize ill-formed { } expressions in regcomp.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ulrich Drepper committed Aug 23, 2009
1 parent bdc7f5d commit 52db803
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
2 changes: 1 addition & 1 deletion posix/regcomp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 52db803

Please sign in to comment.