aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-openflow_v5.c
diff options
context:
space:
mode:
authorAlexis La Goutte <alexis.lagoutte@gmail.com>2016-10-04 15:16:02 +0200
committerMichael Mann <mmann78@netscape.net>2016-10-04 21:55:26 +0000
commit23f11b755202d6ba9b7a8b80df7264992e3a41f0 (patch)
tree7df14845f59dc86e192bc1e20e983ac37aff97d2 /epan/dissectors/packet-openflow_v5.c
parentdda1ee05b3b5e439a3dd1ed6944f5e797b5ed995 (diff)
Openflow (v4/v5): Add check if all length is decoded
Change-Id: I7846dd04c45d0398ded8345b6a2794d6f851cb64 Ping-Bug: 12979 Reviewed-on: https://code.wireshark.org/review/18065 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-openflow_v5.c')
-rw-r--r--epan/dissectors/packet-openflow_v5.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/epan/dissectors/packet-openflow_v5.c b/epan/dissectors/packet-openflow_v5.c
index cc9d9d4d4e..dc9d78d801 100644
--- a/epan/dissectors/packet-openflow_v5.c
+++ b/epan/dissectors/packet-openflow_v5.c
@@ -1146,6 +1146,7 @@ dissect_openflow_oxm_v5(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
{
proto_tree *oxm_tree;
guint16 oxm_class;
+ guint16 oxm_end;
guint8 oxm_field_hm;
guint8 oxm_hm;
guint8 oxm_field;
@@ -1155,6 +1156,7 @@ dissect_openflow_oxm_v5(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
oxm_class = tvb_get_ntohs(tvb, offset);
oxm_field_hm = tvb_get_guint8(tvb, offset + 2);
oxm_length = tvb_get_guint8(tvb, offset + 3);
+ oxm_end = offset + 4 + oxm_length;
oxm_field = (oxm_field_hm & OXM_FIELD_MASK) >> OXM_FIELD_OFFSET;
oxm_hm = oxm_field_hm & OXM_HM_MASK;
@@ -1260,6 +1262,12 @@ dissect_openflow_oxm_v5(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
break;
}
+ if(oxm_end > offset){
+ proto_tree_add_expert_format(oxm_tree, pinfo, &ei_openflow_v5_oxm_undecoded,
+ tvb, offset, oxm_end-offset, "Undecoded Data");
+ offset = oxm_end;
+ }
+
} else {
proto_tree_add_expert_format(oxm_tree, pinfo, &ei_openflow_v5_oxm_undecoded,
tvb, offset, oxm_length, "Unknown OXM body.");