mysql: Correct query attribute handling

This fixes dissection of queries with new clients with query attribute
support to servers that don't support this.
This commit is contained in:
Daniël van Eeden 2022-08-11 09:44:51 +02:00 committed by A Wireshark GitLab Utility
parent 903a5a74ee
commit 913a96a2d3
1 changed files with 3 additions and 1 deletions

View File

@ -2036,7 +2036,9 @@ mysql_dissect_request(tvbuff_t *tvb,packet_info *pinfo, int offset, proto_tree *
break;
case MYSQL_QUERY:
if (conn_data->clnt_caps_ext & MYSQL_CAPS_QA) {
/* Check both the extended capabilities of the client and server. The flag is set by the client
* even if the server didn't set it. This is only actively used if both set the flag. */
if ((conn_data->clnt_caps_ext & MYSQL_CAPS_QA) && (conn_data->srv_caps_ext & MYSQL_CAPS_QA)){
proto_item *query_attrs_item = proto_tree_add_item(req_tree, hf_mysql_query_attributes, tvb, offset, -1, ENC_NA);
proto_item *query_attrs_tree = proto_item_add_subtree(query_attrs_item, ett_query_attributes);