diff options
author | Guy Harris <guy@alum.mit.edu> | 2014-08-18 12:43:59 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2014-08-18 19:44:22 +0000 |
commit | 7b7dd1efcef07dbdb69320e13832a4d7a087b9a8 (patch) | |
tree | 487ad37f0bb24baa701a4a6fb426c382bfd2bc12 /epan | |
parent | 9d6d19254cd7e264fcc886ec24b505ebd6156109 (diff) |
Don't use -1 as the length of an integer.
That's not supported. Put the unknown enterprise number in a a 4-byte
value, as that's what it is, and then just skip to the end of the
packet.
Change-Id: I2cce84bfbb46a114d4809dbc61a021d497eb87a8
Reviewed-on: https://code.wireshark.org/review/3708
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-sflow.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/epan/dissectors/packet-sflow.c b/epan/dissectors/packet-sflow.c index f8c6f06348..183052095c 100644 --- a/epan/dissectors/packet-sflow.c +++ b/epan/dissectors/packet-sflow.c @@ -1687,8 +1687,9 @@ dissect_sflow_5_flow_record(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, /* unknown enterprise format, what to do?? */ flow_data_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_sflow_5_flow_record, &ti, "Unknown enterprise format"); - proto_tree_add_uint_format_value(flow_data_tree, hf_sflow_enterprise, tvb, offset, -1, + proto_tree_add_uint_format_value(flow_data_tree, hf_sflow_enterprise, tvb, offset, 4, enterprise, "Non-standard sFlow (%u)", enterprise); + offset = tvb_captured_length(tvb); } proto_item_set_end(ti, tvb, offset); @@ -2012,8 +2013,9 @@ dissect_sflow_5_counters_record(tvbuff_t *tvb, proto_tree *tree, gint offset) { } else { /* unknown enterprise format, what to do?? */ counter_data_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_sflow_5_counters_record, &ti, "Unknown enterprise format"); - proto_tree_add_uint_format_value(counter_data_tree, hf_sflow_enterprise, tvb, offset, -1, + proto_tree_add_uint_format_value(counter_data_tree, hf_sflow_enterprise, tvb, offset, 4, enterprise, "Non-standard sFlow (%u)", enterprise); + offset = tvb_captured_length(tvb); } proto_item_set_end(ti, tvb, offset); @@ -2302,8 +2304,9 @@ dissect_sflow_245_samples(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, g } else { /* unknown enterprise format, what to do?? */ sflow_245_sample_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_sflow_245_sample, &ti, "Unknown enterprise format"); - proto_tree_add_uint_format_value(sflow_245_sample_tree, hf_sflow_enterprise, tvb, offset, -1, + proto_tree_add_uint_format_value(sflow_245_sample_tree, hf_sflow_enterprise, tvb, offset, 4, enterprise, "Non-standard sFlow (%u)", enterprise); + offset = tvb_captured_length(tvb); } } else { /* version 2 or 4 */ |