Bugfix for S101 dissector:

Make sure that the packet has an S101 header, before setting the protocol name
with col_set_str(). Otherwise, all TCP packets on port 9000 may be
misidentified as S101 packets.


(cherry picked from commit 8e256b7e69)
This commit is contained in:
Thomas Dreibholz 2021-06-26 13:32:22 +02:00 committed by Wireshark GitLab Utility
parent 490fe2684b
commit 40496f3185
1 changed files with 4 additions and 3 deletions

View File

@ -360,9 +360,6 @@ dissect_S101(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if (len < S101_MIN_LENGTH)
return 0;
/* Set the Protocol column to the constant string of S101 */
col_set_str(pinfo->cinfo, COL_PROTOCOL, "S101");
current_offset = 0;
do {
offset = current_offset;
@ -370,6 +367,10 @@ dissect_S101(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if (0 == find_s101_packet_header(tvb, &offset, &start, &slot, &message, &version, &dtd, &command, &flags, &app_bytes[0], &msgLength, &crc)) {
break;
}
if (0 == current_offset) {
/* Set the Protocol column to the constant string of S101 */
col_set_str(pinfo->cinfo, COL_PROTOCOL, "S101");
}
/* create display subtree for the protocol */
ti = proto_tree_add_item(tree, proto_S101, tvb, current_offset, -1, ENC_NA);