cdp: fix tvbuff.c:4429: failed assertion len > 0

tvb_bytes_to_str don't support length = 0
This commit is contained in:
Alexis La Goutte 2022-01-19 11:37:45 +01:00 committed by A Wireshark GitLab Utility
parent ccdcc91e81
commit 5ec5edec0f
1 changed files with 4 additions and 1 deletions

View File

@ -1149,7 +1149,10 @@ dissect_address_tlv(tvbuff_t *tvb, packet_info* pinfo, int offset, int length, p
if (hf_addr == -1)
{
proto_tree_add_item(address_tree, hf_cdp_address, tvb, offset, address_length, ENC_NA);
proto_item_set_text(ti, "Address: %s", tvb_bytes_to_str(pinfo->pool, tvb, offset, address_length));
if(address_length)
{
proto_item_set_text(ti, "Address: %s", tvb_bytes_to_str(pinfo->pool, tvb, offset, address_length));
}
}
return 2 + protocol_length + 2 + address_length;