1
0
mirror of https://github.com/nmap/nmap.git synced 2026-01-02 04:49:02 +00:00

Properly parse udp tracker port number

This commit is contained in:
dmiller
2018-05-04 05:10:55 +00:00
parent fe4830dbf7
commit 6d93755fe6

View File

@@ -954,7 +954,8 @@ Torrent =
-- peers. For a good specification refer to:
-- http://www.rasterbar.com/products/libtorrent/udp_tracker_protocol.html
udp_tracker_peers = function(self, tracker)
local host, port = tracker:match("^udp://(.-):(.+)")
local host, port = tracker:match("^udp://(.-):(%d+)")
port = tonumber(port)
if (not host) or (not port) then
return false, "Could not parse tracker url"
end