diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/regex.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/regex.c b/src/regex.c index faa645cdd28..75f7de34646 100644 --- a/src/regex.c +++ b/src/regex.c | |||
| @@ -3311,15 +3311,15 @@ regex_compile (const_re_char *pattern, size_t size, reg_syntax_t syntax, | |||
| 3311 | GET_INTERVAL_COUNT (lower_bound); | 3311 | GET_INTERVAL_COUNT (lower_bound); |
| 3312 | 3312 | ||
| 3313 | if (c == ',') | 3313 | if (c == ',') |
| 3314 | { | 3314 | GET_INTERVAL_COUNT (upper_bound); |
| 3315 | GET_INTERVAL_COUNT (upper_bound); | ||
| 3316 | if (upper_bound < lower_bound) | ||
| 3317 | FREE_STACK_RETURN (REG_BADBR); | ||
| 3318 | } | ||
| 3319 | else | 3315 | else |
| 3320 | /* Interval such as `{1}' => match exactly once. */ | 3316 | /* Interval such as `{1}' => match exactly once. */ |
| 3321 | upper_bound = lower_bound; | 3317 | upper_bound = lower_bound; |
| 3322 | 3318 | ||
| 3319 | if (lower_bound < 0 | ||
| 3320 | || (0 <= upper_bound && upper_bound < lower_bound)) | ||
| 3321 | FREE_STACK_RETURN (REG_BADBR); | ||
| 3322 | |||
| 3323 | if (!(syntax & RE_NO_BK_BRACES)) | 3323 | if (!(syntax & RE_NO_BK_BRACES)) |
| 3324 | { | 3324 | { |
| 3325 | if (c != '\\') | 3325 | if (c != '\\') |