From fc15fe3b4a771a0a05d7b8ea07545eb4d3690f68 Mon Sep 17 00:00:00 2001 From: Alexis La Goutte Date: Wed, 1 Mar 2023 13:35:16 +0100 Subject: DRDA: Add SQL Statement Length Add missing length to SQL Statement Close: 18876 --- epan/dissectors/packet-drda.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/epan/dissectors/packet-drda.c b/epan/dissectors/packet-drda.c index c6231f04cc..659c4848bd 100644 --- a/epan/dissectors/packet-drda.c +++ b/epan/dissectors/packet-drda.c @@ -59,6 +59,7 @@ static int hf_drda_param_length = -1; static int hf_drda_param_codepoint = -1; static int hf_drda_param_data = -1; static int hf_drda_param_data_ebcdic = -1; +static int hf_drda_sqlstatement_length = -1; static int hf_drda_sqlstatement = -1; static int hf_drda_sqlstatement_ebcdic = -1; @@ -716,7 +717,8 @@ dissect_drda_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data tvbuff_t* next_tvb = NULL; next_tvb = tvb_new_subset_length(tvb, offset + 4, iLengthParam - 4); add_new_data_source(pinfo, next_tvb, "SQL statement"); - proto_tree_add_item(drdaroot_tree, hf_drda_sqlstatement, next_tvb, 0, iLengthParam - 5, ENC_UTF_8); + proto_tree_add_item(drdaroot_tree, hf_drda_sqlstatement_length, next_tvb, 0, 1, ENC_NA); + proto_tree_add_item(drdaroot_tree, hf_drda_sqlstatement, next_tvb, 1, iLengthParam - 6, ENC_UTF_8); proto_tree_add_item(drdaroot_tree, hf_drda_sqlstatement_ebcdic, next_tvb, 0, iLengthParam - 4, ENC_EBCDIC); } } @@ -847,6 +849,11 @@ proto_register_drda(void) FT_STRING, BASE_NONE, NULL, 0x0, "Param data converted from EBCDIC to ASCII for display", HFILL }}, + { &hf_drda_sqlstatement_length, + { "SQL statement Length", "drda.sqlstatement.length", + FT_UINT8, BASE_DEC, NULL, 0x0, + NULL, HFILL }}, + { &hf_drda_sqlstatement, { "SQL statement (ASCII)", "drda.sqlstatement", FT_STRING, BASE_NONE, NULL, 0x0, -- cgit v1.2.3