summaryrefslogtreecommitdiff
path: root/epan/dissectors/packet-bfcp.c
diff options
context:
space:
mode:
Diffstat (limited to 'epan/dissectors/packet-bfcp.c')
-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;