Skip to content

Commit

Permalink
Fix: regex segfault of max_groups is exceeded
Browse files Browse the repository at this point in the history
  • Loading branch information
NormB committed Apr 29, 2023
1 parent 806381e commit 7bd5ff8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions modules/regex/regex_mod.c
Original file line number Diff line number Diff line change
Expand Up @@ -326,9 +326,9 @@ static int load_pcres(int action)
i++;
/* Check if there are more patterns than the max value */
if (i >= max_groups) {
LM_ERR("max patterns exceeded\n");
fclose(f);
goto err;
i--;
LM_ERR("max_groups: %d exceeded, continuing without proessing subsequent groups\n", max_groups);
break;
}
/* Start the regular expression with '(' */
patterns[i][0] = '(';
Expand Down

0 comments on commit 7bd5ff8

Please sign in to comment.