Skip to content

Commit

Permalink
Fix ReDoS issue (#5539)
Browse files Browse the repository at this point in the history
  • Loading branch information
hudochenkov committed Sep 15, 2021
1 parent 3233c82 commit 92e5068
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rules/indentation/index.js
Expand Up @@ -628,7 +628,7 @@ function inferRootIndentLevel(root, baseIndentLevel, indentSize) {
}

const indents = [];
const foundIndents = /(?:^|\n)([ \t]*)\S[^\r\n]*(?:\r?\n\s*)*$/m.exec(root.raws.beforeStart);
const foundIndents = /(?:^|\n)([ \t]*)\S/m.exec(root.raws.beforeStart);

// The indent level of the CSS code block in non-CSS-like files is determined by the shortest indent of non-empty line.
if (foundIndents) {
Expand Down

0 comments on commit 92e5068

Please sign in to comment.