Skip to content

Commit

Permalink
tools: fix wireshark dissector TLV options without data (#4458)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
marcodermatt committed Dec 21, 2023
1 parent 4fc6ad8 commit c5a9760
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tools/wireshark/scion.lua
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,9 @@ function scion_extn_tlv_option_dissect(tvbuf, pktinfo, root)
else
-- no specific dissector
ret_len = data_len
tree:add(scion_extn_tlv_option_value, tlv.data)
if tlv.data ~= nil then
tree:add(scion_extn_tlv_option_value, tlv.data)
end
end

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

0 comments on commit c5a9760

Please sign in to comment.