diff options
author | Robert Sauter <sauter@locoslab.com> | 2017-06-12 01:22:44 +0200 |
---|---|---|
committer | Pascal Quantin <pascal.quantin@gmail.com> | 2017-06-12 07:16:45 +0000 |
commit | b8e660edc66d7f40545868a377b3385b4c9a54cb (patch) | |
tree | 8c10789fbcee5db8845fb50bb122abaaa003dbb1 /epan/dissectors | |
parent | 6b09377285919333910810bcb0480f9413c5f452 (diff) | |
download | wireshark-b8e660edc66d7f40545868a377b3385b4c9a54cb.tar.gz |
IEEE 802.15.4: Fix double offset increment for Time Correction Header IE
Regression by https://code.wireshark.org/review/21890/
Change-Id: Ieb90672dc2181f5951a8a4165e2676b7882282e5
Reviewed-on: https://code.wireshark.org/review/22087
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Diffstat (limited to 'epan/dissectors')
-rw-r--r-- | epan/dissectors/packet-ieee802154.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/epan/dissectors/packet-ieee802154.c b/epan/dissectors/packet-ieee802154.c index 98f9860a9f..871faa100a 100644 --- a/epan/dissectors/packet-ieee802154.c +++ b/epan/dissectors/packet-ieee802154.c @@ -278,7 +278,6 @@ static int dissect_ieee802154_payload_mlme_sub_ie(tvbuff_t *tvb, packet_info *p static int dissect_ieee802154_payload_ie (tvbuff_t *, packet_info *, proto_tree *, int offset); static int dissect_ieee802154_vendor_ie (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset, gint pie_length); static void dissect_802154_enhanced_beacon_filter(tvbuff_t *tvb, proto_tree *subtree, guint16 psie_remaining, gint *offset); -static void dissect_802154_h_ie_time_correction(tvbuff_t *, proto_tree *, guint *, packet_info *pinfo); static void dissect_802154_tsch_time_sync(tvbuff_t *, proto_tree *, int *, guint); static void dissect_802154_tsch_timeslot(tvbuff_t *, proto_tree *, guint, guint16, gint*); static void dissect_802154_tsch_slotframe_link(tvbuff_t *, proto_tree *, guint16, guint16, guint *); @@ -1959,7 +1958,7 @@ dissect_ieee802154_fcs: *@param offset offset into the tvbuff to begin dissection. */ static void -dissect_802154_h_ie_time_correction(tvbuff_t *tvb, proto_tree *h_inf_elem_tree, guint *offset, packet_info *pinfo) { +dissect_802154_h_ie_time_correction(tvbuff_t *tvb, proto_tree *h_inf_elem_tree, guint offset, packet_info *pinfo) { guint16 raw_data; proto_tree *time_correction_tree = NULL; @@ -1968,7 +1967,7 @@ dissect_802154_h_ie_time_correction(tvbuff_t *tvb, proto_tree *h_inf_elem_tree, proto_item *boolean_item = NULL; proto_item *drift_item = NULL; - raw_data = tvb_get_letohs(tvb, *offset); + raw_data = tvb_get_letohs(tvb, offset); is_nack = (gboolean) ((raw_data & (guint16)0x8000) ? 1 : 0); gint16 drift_us = 0; @@ -1977,24 +1976,21 @@ dissect_802154_h_ie_time_correction(tvbuff_t *tvb, proto_tree *h_inf_elem_tree, } else { /* Positive integer */ drift_us = (gint16) (raw_data & 0x0fff); } - time_correction_item = proto_tree_add_bytes_format_value(h_inf_elem_tree, hf_ieee802154_time_correction, tvb, *offset, 2, NULL, + time_correction_item = proto_tree_add_bytes_format_value(h_inf_elem_tree, hf_ieee802154_time_correction, tvb, offset, 2, NULL, "Time correction: %d us | Non-acknowledgement: %s", drift_us, (guint32) is_nack ? "True" : "False"); time_correction_tree = proto_item_add_subtree(time_correction_item, ett_ieee802154_h_ie_payload); /* Valid time correct value */ if(raw_data <= 0x8fff) { - drift_item = proto_tree_add_int(time_correction_tree, hf_ieee802154_time_correction_value, tvb, *offset, 2, drift_us); + drift_item = proto_tree_add_int(time_correction_tree, hf_ieee802154_time_correction_value, tvb, offset, 2, drift_us); PROTO_ITEM_SET_GENERATED(drift_item); - boolean_item = proto_tree_add_boolean(time_correction_tree, hf_ieee802154_nack, tvb, *offset, 2, (guint32) is_nack); + boolean_item = proto_tree_add_boolean(time_correction_tree, hf_ieee802154_nack, tvb, offset, 2, (guint32) is_nack); PROTO_ITEM_SET_GENERATED(boolean_item); } /* Incorrect value */ else { expert_add_info(pinfo, time_correction_item, &ei_ieee802154_time_correction_error); } - - - *offset += 2; } /* dissect_802154_h_ie_time_correction */ /** @@ -2499,7 +2495,7 @@ dissect_ieee802154_header_ie(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree * case IEEE802154_HEADER_IE_TIME_CORR: // 7.4.2.7 Time Correction IE - dissect_802154_h_ie_time_correction(tvb, subtree, offset, pinfo); + dissect_802154_h_ie_time_correction(tvb, subtree, *offset, pinfo); break; case IEEE802154_HEADER_VENDOR_SPECIFIC: |