diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-26 17:44:25 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-26 17:44:25 +0000 |
commit | f59ea5f7690c9a01ef6f7f6508084a66c40b1dae (patch) | |
tree | 482ee255d71f113be6c62e9ff3543fd6ebb9f12a /epan/dissectors/packet-zbee-nwk-gp.c | |
parent | Releasing progress-linux version 4.2.2-1.1~progress7.99u1. (diff) | |
download | wireshark-f59ea5f7690c9a01ef6f7f6508084a66c40b1dae.tar.xz wireshark-f59ea5f7690c9a01ef6f7f6508084a66c40b1dae.zip |
Merging upstream version 4.2.4.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'epan/dissectors/packet-zbee-nwk-gp.c')
-rw-r--r-- | epan/dissectors/packet-zbee-nwk-gp.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/epan/dissectors/packet-zbee-nwk-gp.c b/epan/dissectors/packet-zbee-nwk-gp.c index 5d6e827..25dc8e0 100644 --- a/epan/dissectors/packet-zbee-nwk-gp.c +++ b/epan/dissectors/packet-zbee-nwk-gp.c @@ -1502,8 +1502,11 @@ static guint dissect_zbee_nwk_gp_cmd_move_up_down(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, zbee_nwk_green_power_packet *packet _U_, guint offset) { - proto_tree_add_item(tree, hf_zbee_nwk_gp_cmd_move_up_down_rate, tvb, offset, 1, ENC_LITTLE_ENDIAN); - offset += 1; + /* Optional rate field. */ + if (tvb_reported_length(tvb) - offset >= 1) { + proto_tree_add_item(tree, hf_zbee_nwk_gp_cmd_move_up_down_rate, tvb, offset, 1, ENC_LITTLE_ENDIAN); + offset += 1; + } return offset; } /* dissect_zbee_nwk_gp_cmd_move_up_down */ @@ -1549,8 +1552,11 @@ dissect_zbee_nwk_gp_cmd_step_up_down(tvbuff_t *tvb, packet_info *pinfo _U_, prot { proto_tree_add_item(tree, hf_zbee_nwk_gp_cmd_step_up_down_step_size, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; - proto_tree_add_item(tree, hf_zbee_nwk_gp_cmd_step_up_down_transition_time, tvb, offset, 2, ENC_LITTLE_ENDIAN); - offset += 2; + /* Optional time field. */ + if (tvb_reported_length(tvb) - offset >= 2) { + proto_tree_add_item(tree, hf_zbee_nwk_gp_cmd_step_up_down_transition_time, tvb, offset, 2, ENC_LITTLE_ENDIAN); + offset += 2; + } return offset; } /* dissect_zbee_nwk_gp_cmd_step_up_down */ |