From c5a9760d4b904c1d17f870c1606f2445fa712a53 Mon Sep 17 00:00:00 2001 From: marcodermatt <30311154+marcodermatt@users.noreply.github.com> Date: Thu, 21 Dec 2023 13:00:31 +0100 Subject: [PATCH] tools: fix wireshark dissector TLV options without data (#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. --- tools/wireshark/scion.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/wireshark/scion.lua b/tools/wireshark/scion.lua index c6503cc721..5ec622c68b 100644 --- a/tools/wireshark/scion.lua +++ b/tools/wireshark/scion.lua @@ -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()]