Details
-
Bug
-
Resolution: Fixed
-
Not Evaluated
-
5.15, 6.2, 6.5, 6.6, 6.7, 6.8, 6.9
-
None
-
a041cd352 (dev), 4c1a82e4c (6.8), 3bb0cb673 (dev)
Description
Reporting here an issue that has been reported in a qBittorent issue, see this comment.
If the input to QRegularExpression::wildcardToRegularExpression (browse code) contains multiple consecutive stars (i.e. ****), it may cause catastrophic backtracking when using the resulting regex.
Of course, the problem worsens as the amount of consecutive stars increases, easily hanging the program. And often, the end user can control the input...
This issue can easily be solved by merging the consecutive stars into a single .*, as so:
case '*': rx += settings.starEscape; +++ while (i < wclen && wc[i] == u'*') { +++ ++i; +++ } break;