diff options
author | Ronald Wahl <rwahl@gmx.de> | 2021-03-11 02:11:19 +0100 |
---|---|---|
committer | Ronald Wahl <rwahl@gmx.de> | 2021-03-11 02:42:33 +0100 |
commit | 62102562297e188c521688e0b3c3ff4c2daae4eb (patch) | |
tree | e56fe657ecedfbd4441db29637e114d29fa85596 /epan/dissectors/packet-lldp.c | |
parent | 7446a16247a8f04b1fa476e526cdaa97be00f32e (diff) |
LLDP: Allow organizational specific TLVs without payload
Currently organizational specific TLVs without payload cause an
exception which leads to a 'malformed packet' error. Add a check that
allows correctly parsing those TLVs.
Diffstat (limited to 'epan/dissectors/packet-lldp.c')
-rw-r--r-- | epan/dissectors/packet-lldp.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/epan/dissectors/packet-lldp.c b/epan/dissectors/packet-lldp.c index 7f86bd7237..3eb3091b00 100644 --- a/epan/dissectors/packet-lldp.c +++ b/epan/dissectors/packet-lldp.c @@ -2613,7 +2613,9 @@ static void dissect_oui_default_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_tree_add_item(tree, hf_unknown_subtype, tvb, 0, 1, ENC_BIG_ENDIAN); - proto_tree_add_item(tree, hf_unknown_subtype_content, tvb, 1, -1, ENC_NA); + if (tvb_captured_length_remaining(tvb, 1) > 0) { + proto_tree_add_item(tree, hf_unknown_subtype_content, tvb, 1, -1, ENC_NA); + } } static void |