DHCPv6: Fix failed assertion tvb_bytes_to_str()

Check address_length before calling tvb_bytes_to_str()
Related to #17890
This commit is contained in:
Uli Heilmeier 2022-01-23 21:02:56 +01:00 committed by A Wireshark GitLab Utility
parent ac2389d3e4
commit a202350f6f
1 changed files with 3 additions and 1 deletions

View File

@ -1861,7 +1861,9 @@ dhcpv6_option(tvbuff_t *tvb, packet_info *pinfo, proto_tree *bp_tree,
switch (opttype) {
case OPTION_CLIENTID:
col_append_fstr(pinfo->cinfo, COL_INFO, "CID: %s ", tvb_bytes_to_str(pinfo->pool, tvb, off, optlen));
if (optlen > 0) {
col_append_fstr(pinfo->cinfo, COL_INFO, "CID: %s ", tvb_bytes_to_str(pinfo->pool, tvb, off, optlen));
}
/* Fall through */
case OPTION_SERVERID:
case OPTION_RELAYID: