aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-mausb.c
diff options
context:
space:
mode:
authorSean O. Stalley <sean.stalley@intel.com>2014-05-06 12:12:09 -0700
committerPascal Quantin <pascal.quantin@gmail.com>2014-05-06 19:51:56 +0000
commit9a51c1e5306d0d5444096f62619ce8186794a29b (patch)
treea0beeeb442a36020347d3f3a264555d225da315c /epan/dissectors/packet-mausb.c
parentd73fc0b2945196dd4a32b3797d5881182fc83d36 (diff)
Added check for MAUSB length being multiple of a DWORD.
MAUSB Packets should always be sent in DWORDs. This means that the only valid values for the length field are multiples of 4. This patch adds an expert info check to flag length fields that are multiples of 4. Change-Id: Ifb793f82aed4c9fb09a12f6ea97087733b58d14a Reviewed-on: https://code.wireshark.org/review/1536 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-mausb.c')
-rw-r--r--epan/dissectors/packet-mausb.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/epan/dissectors/packet-mausb.c b/epan/dissectors/packet-mausb.c
index 5bc8913729..395fd00f90 100644
--- a/epan/dissectors/packet-mausb.c
+++ b/epan/dissectors/packet-mausb.c
@@ -103,6 +103,7 @@ static int hf_mausb_payload = -1;
/* expert info fields */
static expert_field ei_ep_handle_len = EI_INIT;
static expert_field ei_len = EI_INIT;
+static expert_field ei_len_dword = EI_INIT;
static expert_field ei_mgmt_type_undef = EI_INIT;
static expert_field ei_mgmt_type_spec_len_long = EI_INIT;
static expert_field ei_mgmt_type_spec_len_short = EI_INIT;
@@ -925,6 +926,9 @@ dissect_mausb_pkt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if (tvb_reported_length(tvb) != header.length) {
expert_add_info(pinfo, len_field, &ei_len);
}
+ if (0 != header.length % 4) {
+ expert_add_info(pinfo, len_field, &ei_len_dword);
+ }
/* Is the next field a device handle or an endpoint handle */
@@ -1391,6 +1395,10 @@ proto_register_mausb(void)
{ "mausb.length", PI_MALFORMED, PI_ERROR,
"Packet length field does not match size of packet", EXPFILL }
},
+ { &ei_len_dword,
+ { "mausb.length", PI_PROTOCOL, PI_WARN,
+ "Packet contains partial DWORD", EXPFILL }
+ },
{ &ei_mgmt_type_undef,
{ "mausb.type", PI_PROTOCOL, PI_WARN,
"Undefined managment packet type", EXPFILL }