From 6d93755fe6c043184e250b74f65d25f9d308a967 Mon Sep 17 00:00:00 2001 From: dmiller Date: Fri, 4 May 2018 05:10:55 +0000 Subject: [PATCH] Properly parse udp tracker port number --- nselib/bittorrent.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nselib/bittorrent.lua b/nselib/bittorrent.lua index f7637361d..8f1f2ce6b 100644 --- a/nselib/bittorrent.lua +++ b/nselib/bittorrent.lua @@ -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