Skip to content

Commit fe75272

Browse files
authored
fix(parse-http): ignore announcements from peers with invalid announcement ports. (#513)
1 parent ea1e78e commit fe75272

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/server/parse-http.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export default function (req, opts) {
2222
params.peer_id = bin2hex(params.peer_id)
2323

2424
params.port = Number(params.port)
25-
if (!params.port) throw new Error('invalid port')
25+
if (!params.port || params.port <= 0 || params.port > 65535) throw new Error('invalid port')
2626

2727
params.left = Number(params.left)
2828
if (Number.isNaN(params.left)) params.left = Infinity

0 commit comments

Comments
 (0)