1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-06 04:31:29 +00:00

Don't let UDP decoding bugs kill broadcast-listener main thread

This commit is contained in:
dmiller
2020-02-18 17:37:57 +00:00
parent 5d281d0e6e
commit 4a38853631

View File

@@ -153,10 +153,12 @@ sniffInterface = function(iface, Decoders, decodertab)
-- if we have an UDP-based broadcast, we should have a proper packet
if ( p and p.udp_dport and ( decodertab.udp[p.udp_dport] or Decoders.udp[p.udp_dport] ) ) then
if ( not(decodertab.udp[p.udp_dport]) ) then
decodertab.udp[p.udp_dport] = Decoders.udp[p.udp_dport]:new()
local uport = p.udp_dport
if ( not(decodertab.udp[uport]) ) then
decodertab.udp[uport] = Decoders.udp[uport]:new()
end
decodertab.udp[p.udp_dport]:process(data)
stdnse.new_thread(decodertab.udp[uport].process, decodertab.udp[uport], data)
decoded = true
-- The packet was decoded successfully but we don't have a valid decoder
-- Report this
elseif ( p and p.udp_dport ) then