Aaron Conole via dev <[email protected]> writes:

> The regex_if_macros accidentally implements a catastrophic backtracking
> case during matching because it forces a greedy match and evaluation that
> causes an explosion of combinations depending on how many blocks appear
> in a parenthesized expression.
>
> Consider an expression like:
>
>   if (a b c d e f g h i j k) {
>
> The regex engine will have to create an exponential number of matches that
> can overload memory and cpu requirements.
>
> Fix this by switching the inner-content match to use a non-greedy approach.
>
> Signed-off-by: Aaron Conole <[email protected]>
> ---

Oof, should have rechecked the tests.  I'll send a v2 with an improved
regex that covers the case:

  $ctr (a) {   \

and include the tag:

Fixes: aacad8685e3d ("checkpatch: Fix regexp for if, while, etc inside macros.")

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to