Skip to content

Commit eb86332

Browse files
authored
Prevent ReDos issue with regex inside gopher_parsedir (#446)
1 parent 243b723 commit eb86332

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/php/net-gopher/gopher_parsedir.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ module.exports = function gopher_parsedir (dirent) { // eslint-disable-line came
2222
* s = Audio file format, primarily a WAV file
2323
*/
2424

25-
const entryPattern = /^(.)(.*?)\t(.*?)\t(.*?)\t(.*?)\u000d\u000a$/
25+
const entryPattern = /^(.)([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*)\r\n$/
2626
const entry = dirent.match(entryPattern)
2727

2828
if (entry === null) {

0 commit comments

Comments
 (0)