Skip to content

Commit 1579977

Browse files
marcodermattjuagargi
authored andcommitted
tools: fix wireshark dissector TLV options without data (scionproto#4458)
Dissecting TLV options crashes the wireshark plugin, if the `data` field is empty. This happens always for Pad1 options and for PadN options if `data_len` is 0.
1 parent 30ed911 commit 1579977

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tools/wireshark/scion.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,9 @@ function scion_extn_tlv_option_dissect(tvbuf, pktinfo, root)
558558
else
559559
-- no specific dissector
560560
ret_len = data_len
561-
tree:add(scion_extn_tlv_option_value, tlv.data)
561+
if tlv.data ~= nil then
562+
tree:add(scion_extn_tlv_option_value, tlv.data)
563+
end
562564
end
563565

564566
local type_str = scion_extn_tlv_option_types[tlv.type:uint()]

0 commit comments

Comments
 (0)