代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/wireshark 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From d70bd4489feed4035c3a35cd2e76cdf877b3f485 Mon Sep 17 00:00:00 2001
From: Gerald Combs <gerald@wireshark.org>
Date: Mon, 29 Jun 2020 15:19:19 -0700
Subject: [PATCH] GVCP: Fix an infinite loop.
Remove an "if(tree)" test in order to ensure that our offset always
advances.
Bug: 16029
Change-Id: I5bb38f2eccfbf3c44a06682a17aafcba9d8fa0c6
Reviewed-on: https://code.wireshark.org/review/37611
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
---
epan/dissectors/packet-gvcp.c | 101 +++++++++++++++++-----------------
1 file changed, 51 insertions(+), 50 deletions(-)
diff --git a/epan/dissectors/packet-gvcp.c b/epan/dissectors/packet-gvcp.c
index 4b5d950..3a58cfa 100644
--- a/epan/dissectors/packet-gvcp.c
+++ b/epan/dissectors/packet-gvcp.c
@@ -1803,66 +1803,67 @@ static void dissect_eventdata_cmd(proto_tree *gvcp_telegram_tree, tvbuff_t *tvb,
/* fill in Info column in Wireshark GUI */
col_append_fstr(pinfo->cinfo, COL_INFO, "[ID: 0x%04X]", eventid);
- if (gvcp_telegram_tree != NULL)
+ /* If extended ID, then we have event_size here (2.1) */
+ if (extendedblockids)
{
- /* If extended ID, then we have event_size here (2.1) */
- if (extendedblockids)
- {
- proto_tree_add_item(gvcp_telegram_tree, hf_gvcp_eventcmd_extid_length, tvb, offset, 2, ENC_BIG_ENDIAN);
- data_length = tvb_get_ntohs(tvb, offset); // We get the data length here
- }
-
- /* skip reserved field */
- offset += 2;
-
- /* Use range to determine type of event */
- if ((eventid >= 0x0000) && (eventid <= 0x8000))
- {
- /* Standard ID */
- proto_tree_add_item(gvcp_telegram_tree, hf_gvcp_eventcmd_id, tvb, offset, 2, ENC_BIG_ENDIAN);
- }
- else if ((eventid >= 0x8001) && (eventid <= 0x8FFF))
- {
- /* Error */
- proto_tree_add_item(gvcp_telegram_tree, hf_gvcp_eventcmd_error_id, tvb, offset, 2, ENC_BIG_ENDIAN);
- }
- else if ((eventid >= 0x9000) && (eventid <= 0xFFFF))
- {
- /* Device specific */
- proto_tree_add_item(gvcp_telegram_tree, hf_gvcp_eventcmd_device_specific_id, tvb, offset, 2, ENC_BIG_ENDIAN);
- }
+ proto_tree_add_item(gvcp_telegram_tree, hf_gvcp_eventcmd_extid_length, tvb, offset, 2, ENC_BIG_ENDIAN);
+ data_length = tvb_get_ntohs(tvb, offset); // We get the data length here
+ }
+ /* skip reserved field */
+ offset += 2;
+ /* Use range to determine type of event */
+ if ((eventid >= 0x0000) && (eventid <= 0x8000))
+ {
+ /* Standard ID */
+ proto_tree_add_item(gvcp_telegram_tree, hf_gvcp_eventcmd_id, tvb, offset, 2, ENC_BIG_ENDIAN);
+ }
+ else if ((eventid >= 0x8001) && (eventid <= 0x8FFF))
+ {
+ /* Error */
+ proto_tree_add_item(gvcp_telegram_tree, hf_gvcp_eventcmd_error_id, tvb, offset, 2, ENC_BIG_ENDIAN);
+ }
+ else if ((eventid >= 0x9000) && (eventid <= 0xFFFF))
+ {
+ /* Device specific */
+ proto_tree_add_item(gvcp_telegram_tree, hf_gvcp_eventcmd_device_specific_id, tvb, offset, 2, ENC_BIG_ENDIAN);
+ }
+ offset += 2;
+
+ /* Stream channel (possibly) associated with event */
+ proto_tree_add_item(gvcp_telegram_tree, hf_gvcp_eventcmd_stream_channel_index, tvb, offset, 2, ENC_BIG_ENDIAN);
+ if (extendedblockids == 0)
+ {
+ /* Block id (16 bit) associated with event */
+ proto_tree_add_item(gvcp_telegram_tree, hf_gvcp_eventcmd_block_id, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
-
- /* Stream channel (possibly) associated with event */
- proto_tree_add_item(gvcp_telegram_tree, hf_gvcp_eventcmd_stream_channel_index, tvb, offset, 2, ENC_BIG_ENDIAN);
+ }
+ else
+ {
offset += 2;
-
- if (extendedblockids == 0)
- {
- /* Block id (16 bit) associated with event */
- proto_tree_add_item(gvcp_telegram_tree, hf_gvcp_eventcmd_block_id, tvb, offset, 2, ENC_BIG_ENDIAN);
- offset += 2;
- }
- else
- {
- offset += 2;
- /* Block id (64 bit) only if reported by gvcp flag */
- proto_tree_add_item(gvcp_telegram_tree, hf_gvcp_eventcmd_block_id_64bit_v2_0, tvb, offset, 8, ENC_BIG_ENDIAN);
- offset += 8;
- }
-
- /* Timestamp (64 bit) associated with event */
- proto_tree_add_item(gvcp_telegram_tree, hf_gvcp_eventcmd_timestamp, tvb, offset, 8, ENC_BIG_ENDIAN);
+ /* Block id (64 bit) only if reportedby gvcp flag */
+ proto_tree_add_item(gvcp_telegram_tree, hf_gvcp_eventcmd_block_id_64bit_v2_0, tvb, offset, 8, ENC_BIG_ENDIAN);
offset += 8;
+ }
- if ((data_length == 24) && (extendedblockids))
+ /* Timestamp (64 bit) associated with event */
+ proto_tree_add_item(gvcp_telegram_tree, hf_gvcp_eventcmd_timestamp, tvb, offset, 8, ENC_BIG_ENDIAN);
+ offset += 8;
+
+ if (extendedblockids)
+ {
+ if (data_length > 24)
{
- /* "no data" this is an ok case for extended id, eventcmd to be deprecated */
- return;
+ /* Data */
+ proto_tree_add_item(gvcp_telegram_tree, hf_gvcp_eventcmd_data, tvb, offset, data_length - 24, ENC_NA);
+ offset += data_length - 24;
}
+ }
+ else
+ {
/* Data */
proto_tree_add_item(gvcp_telegram_tree, hf_gvcp_eventcmd_data, tvb, offset, -1, ENC_NA);
+ return;
}
}
--
2.23.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。