Skip to content

Commit 7922e82

Browse files
committed
fix: flagged regex by codeql for security and performance
1 parent 243592b commit 7922e82

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/logger.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const clustering = require('./clustering');
77
const categories = require('./categories');
88
const configuration = require('./configuration');
99

10-
const stackReg = /at (?:(.+)\s+\()?(?:(.+?):(\d+)(?::(\d+))?|([^)]+))\)?/;
10+
const stackReg = /^(?:\s*) at (?:(.+) \()?(?:([^(]+?):(\d+):(\d+))\)?$/;
1111
/**
1212
* The top entry is the Error
1313
*/
@@ -36,7 +36,7 @@ function defaultParseCallStack(
3636
}
3737
const lineMatch = stackReg.exec(stacklines[0]);
3838
/* istanbul ignore else: failsafe */
39-
if (lineMatch && lineMatch.length === 6) {
39+
if (lineMatch && lineMatch.length === 5) {
4040
// extract class, function and alias names
4141
let className = '';
4242
let functionName = '';

0 commit comments

Comments
 (0)