Skip to content

Commit

Permalink
Fix code scanning alert - Polynomial regular expression used on uncon…
Browse files Browse the repository at this point in the history
…trolled data #4
  • Loading branch information
wtto00 committed May 10, 2024
1 parent 9d8f110 commit 1db0551
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export function processKeyValueGroups<T extends object = object>(str: string) {
const results = [];

lines.forEach(function (line) {
const matches = line.match(/([\w/]+):\s(.*)/);
const matches = line.match(/(\w+):\s(.*)/);

Check failure

Code scanning / CodeQL

Polynomial regular expression used on uncontrolled data High

This
regular expression
that depends on
library input
may run slow on strings with many repetitions of 'a'.

if (matches === null) {
return;
Expand Down

0 comments on commit 1db0551

Please sign in to comment.