diff options
author | Guy Harris <guy@alum.mit.edu> | 2017-07-25 15:42:46 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2017-07-25 22:43:20 +0000 |
commit | efbefe2f4c46bf50c6df7e06a06476e3f91e1ba7 (patch) | |
tree | cc2a109eadb39242e8e841f7c6959bc9d9504e46 /epan/dissectors/packet-mysql.c | |
parent | 9c80c4d5a246b8f95dfbc28fbf14ca899531630f (diff) |
Make hf_mysql_request cover the *entire* request.
The request doesn't correspond to the request command coe, it
corresponds to the entire request; create it as an item covering the
rest of the packet, and finish it up by setting the length appropriately.
Change-Id: Ib0c044c0c878f1cb2fa0d11deb04b4d31a8a825f
Reviewed-on: https://code.wireshark.org/review/22796
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan/dissectors/packet-mysql.c')
-rw-r--r-- | epan/dissectors/packet-mysql.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/epan/dissectors/packet-mysql.c b/epan/dissectors/packet-mysql.c index dc6881bf87..1b5ea43b15 100644 --- a/epan/dissectors/packet-mysql.c +++ b/epan/dissectors/packet-mysql.c @@ -1306,7 +1306,7 @@ mysql_dissect_request(tvbuff_t *tvb,packet_info *pinfo, int offset, { gint opcode; gint lenstr; - proto_item *tf = NULL, *ti; + proto_item *request_item, *tf = NULL, *ti; proto_item *req_tree; guint32 stmt_id; my_stmt_data_t *stmt_data; @@ -1316,14 +1316,14 @@ mysql_dissect_request(tvbuff_t *tvb,packet_info *pinfo, int offset, return mysql_dissect_auth_switch_response(tvb, pinfo, offset, tree, conn_data); } - tf = proto_tree_add_item(tree, hf_mysql_request, tvb, offset, 1, ENC_NA); - req_tree = proto_item_add_subtree(tf, ett_request); + request_item = proto_tree_add_item(tree, hf_mysql_request, tvb, offset, -1, ENC_NA); + req_tree = proto_item_add_subtree(request_item, ett_request); opcode = tvb_get_guint8(tvb, offset); col_append_fstr(pinfo->cinfo, COL_INFO, " %s", val_to_str_ext(opcode, &mysql_command_vals_ext, "Unknown (%u)")); proto_tree_add_item(req_tree, hf_mysql_command, tvb, offset, 1, ENC_NA); - proto_item_append_text(tf, " %s", val_to_str_ext(opcode, &mysql_command_vals_ext, "Unknown (%u)")); + proto_item_append_text(request_item, " %s", val_to_str_ext(opcode, &mysql_command_vals_ext, "Unknown (%u)")); offset += 1; @@ -1454,7 +1454,8 @@ mysql_dissect_request(tvbuff_t *tvb,packet_info *pinfo, int offset, case MYSQL_REFRESH: proto_tree_add_bitmask_with_flags(req_tree, tvb, offset, -hf_mysql_refresh, ett_refresh, mysql_rfsh_flags, ENC_BIG_ENDIAN, BMT_NO_APPEND); + hf_mysql_refresh, ett_refresh, mysql_rfsh_flags, + ENC_BIG_ENDIAN, BMT_NO_APPEND); offset += 1; mysql_set_conn_state(pinfo, conn_data, RESPONSE_OK); break; @@ -1595,6 +1596,7 @@ hf_mysql_refresh, ett_refresh, mysql_rfsh_flags, ENC_BIG_ENDIAN, BMT_NO_APPEND); mysql_set_conn_state(pinfo, conn_data, UNDEFINED); } + proto_item_set_end(request_item, tvb, offset); return offset; } |