aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-cattp.c
diff options
context:
space:
mode:
authorMartin Kaiser <wireshark@kaiser.cx>2018-12-08 15:30:26 +0100
committerJaap Keuter <jaap.keuter@xs4all.nl>2018-12-08 16:35:16 +0000
commitac4c11f26eb5544788d08c918252da6c4b1b0b43 (patch)
tree123cd2fb6cd36361b4f01aa45d8062f9722e84aa /epan/dissectors/packet-cattp.c
parenta02d592c76fb1430eff0b1bc7a4a45d39ac4e9eb (diff)
cattp: use the version bits in the heristic check
The CAT-TP specification says explicitly that the version bits must be zero. Fail the heuristic check if they aren't. I checked ETSI TS 102 127 V15.0.0 from https://www.etsi.org/deliver/etsi_ts/102100_102199/102127/15.00.00_60/ts_102127v150000p.pdf Bug: 15342 Change-Id: I05a886ccd5811f367abdb9faead4983d137c12c6 Reviewed-on: https://code.wireshark.org/review/30970 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx> Petri-Dish: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Petri Dish Buildbot Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
Diffstat (limited to 'epan/dissectors/packet-cattp.c')
-rw-r--r--epan/dissectors/packet-cattp.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/epan/dissectors/packet-cattp.c b/epan/dissectors/packet-cattp.c
index f000a739e7..6be847104d 100644
--- a/epan/dissectors/packet-cattp.c
+++ b/epan/dissectors/packet-cattp.c
@@ -321,7 +321,7 @@ static gboolean
dissect_cattp_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
{
if (tvb_captured_length(tvb) >= CATTP_HBLEN) { /* check of data is big enough for base header. */
- guint8 flags, hlen;
+ guint8 flags, ver, hlen;
guint16 plen;
hlen = tvb_get_guint8(tvb, 3); /* header len */
@@ -330,6 +330,12 @@ dissect_cattp_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *da
if (hlen+plen != tvb_reported_length(tvb)) /* check if data length is ok. */
return FALSE;
+ /* ETSI TS 102 127 V15.0.0 and earlier releases say explicitly that
+ the version bits must be 0. */
+ ver = tvb_get_guint8(tvb, 0) & M_VERSION;
+ if (ver != 0)
+ return FALSE;
+
flags = tvb_get_guint8(tvb, 0) & M_FLAGS;
if ( (flags & M_PDU_SYN) == F_SYN ||
(flags & M_PDU_RST) == F_RST ||