summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMalcolm Walters <malcolm.walters@acano.com>2014-07-01 13:38:47 +0100
committerPascal Quantin <pascal.quantin@gmail.com>2014-07-01 20:50:11 +0000
commit5d2747c3cff7c030f1b72726907103d6b097f74c (patch)
treef027557432e5acabe84ae7ba1e5caf52ccf1ab81
parent4b59394f5e1da97305de15c0d1aa3161acbf392c (diff)
downloadwireshark-5d2747c3cff7c030f1b72726907103d6b097f74c.tar.gz
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> (cherry picked from commit 2a306f4b05b156a08788df80648bc2714c412b1f) Reviewed-on: https://code.wireshark.org/review/2760
-rw-r--r--epan/dissectors/packet-bfcp.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/epan/dissectors/packet-bfcp.c b/epan/dissectors/packet-bfcp.c
index 129909ad5c..efa47e103d 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;