DCM: Check if buf_desc is not NULL

Only use buf_desc when it is not NULL.

Related #17890
This commit is contained in:
Uli Heilmeier 2022-01-30 22:18:03 +01:00 committed by A Wireshark GitLab Utility
parent b0036e01f8
commit 37dcb3902b
1 changed files with 6 additions and 5 deletions

View File

@ -1629,12 +1629,13 @@ dissect_dcm_assoc_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gu
break;
}
proto_item_set_text(assoc_header_pitem, "%s", buf_desc);
col_set_str(pinfo->cinfo, COL_INFO, buf_desc);
/* proto_item and proto_tree are one and the same */
proto_item_append_text(tree, ", %s", buf_desc);
if (buf_desc) {
proto_item_set_text(assoc_header_pitem, "%s", buf_desc);
col_set_str(pinfo->cinfo, COL_INFO, buf_desc);
/* proto_item and proto_tree are one and the same */
proto_item_append_text(tree, ", %s", buf_desc);
}
return offset;
}