diff options
author | Thomas Dreibholz <dreibh@simula.no> | 2021-06-26 13:32:22 +0200 |
---|---|---|
committer | Wireshark GitLab Utility <gerald+gitlab-utility@wireshark.org> | 2021-07-10 11:20:13 +0000 |
commit | 40496f31852457fe123029413a83d6c3e36c860e (patch) | |
tree | 640e2f66ec07877f67184a9208d8d91f72a58891 | |
parent | 490fe2684bf63cf4fe03e6495c9ef74c8bc86a2b (diff) |
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 8e256b7e694d6d39f93d41a788835e85855780eb)
-rw-r--r-- | epan/dissectors/packet-s101.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/epan/dissectors/packet-s101.c b/epan/dissectors/packet-s101.c index f0b73f3d66..c7ec8d5135 100644 --- a/epan/dissectors/packet-s101.c +++ b/epan/dissectors/packet-s101.c @@ -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); |