diff options
author | Malcolm Walters <malcolm.walters@acano.com> | 2014-07-01 13:38:47 +0100 |
---|---|---|
committer | Pascal Quantin <pascal.quantin@gmail.com> | 2014-07-01 20:49:30 +0000 |
commit | 2a306f4b05b156a08788df80648bc2714c412b1f (patch) | |
tree | af1cd4371d4c8f19eb695c670fe9bfd2895995ae /epan | |
parent | a73199e31abb0255467f2bf5b5671f34707ad228 (diff) |
Fix for Bug 10240.
Include padding length in calculation of correct attribute length
Change-Id: I569c6a9e1be39e3bb997e797a094b80cdcba6b07
Reviewed-on: https://code.wireshark.org/review/2747
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-bfcp.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/epan/dissectors/packet-bfcp.c b/epan/dissectors/packet-bfcp.c index c5d9ef1ee0..5e6dea05f4 100644 --- a/epan/dissectors/packet-bfcp.c +++ b/epan/dissectors/packet-bfcp.c @@ -209,6 +209,8 @@ dissect_bfcp_attributes(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int length = tvb_get_guint8(tvb, offset); offset++; + pad_len = 0; /* Default to no padding*/ + switch(attribute_type){ case 1: /* Beneficiary ID */ proto_tree_add_item(bfcp_attr_tree, hf_bfcp_beneficiary_id, tvb, offset, 2, ENC_BIG_ENDIAN); @@ -375,7 +377,7 @@ dissect_bfcp_attributes(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset = offset + length - 2; break; } - if (length < (offset - attr_start_offset)){ + if ((length+pad_len) < (offset - attr_start_offset)){ expert_add_info_format(pinfo, item, &ei_bfcp_attribute_length_too_small, "Attribute length is too small (%d bytes)", length); break; |