diff options
author | Stephen Fisher <steve@stephen-fisher.com> | 2007-06-18 18:57:58 +0000 |
---|---|---|
committer | Stephen Fisher <steve@stephen-fisher.com> | 2007-06-18 18:57:58 +0000 |
commit | 9c24cd403649bbe0bc2def7a462a2a00c8630b4e (patch) | |
tree | 214438dc6ccf911890fc45149330ce092b51513b /epan | |
parent | d8200256a6903811b4f31559a62eeacc5e02cc45 (diff) | |
download | wireshark-9c24cd403649bbe0bc2def7a462a2a00c8630b4e.tar.gz |
From Martin Warnes:
Currently the MySQL dissector assumes that an OK-Packet Response
contains the Server_Status field. Having checked the MySQL protocol page
I can't say conclusively whether it should or it shouldn't, however I've
come across a couple of MySQL Java clients that receive the OK-Packet
without the Server_Status field set in response to a "SET AUTOCOMMIT" call.
The attached patched simply adds a check to ensure the Server_Status
field is present before calling function mysql_dissect_server_status.
svn path=/trunk/; revision=22129
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-mysql.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/epan/dissectors/packet-mysql.c b/epan/dissectors/packet-mysql.c index 2a8a405efd..a77ddc44e7 100644 --- a/epan/dissectors/packet-mysql.c +++ b/epan/dissectors/packet-mysql.c @@ -1687,15 +1687,17 @@ static int mysql_dissect_ok_packet(tvbuff_t *tvb, packet_info *pinfo, int offset } offset+= fle; - offset= mysql_dissect_server_status(tvb, offset, tree); - - /* 4.1+ protocol only: 2 bytes number of warnings */ - if (conn_data->clnt_caps & conn_data->srv_caps & MYSQL_CAPS_CU) { - if (tree) { - proto_tree_add_item(tree, hf_mysql_num_warn, tvb, - offset, 2, FALSE); - } + if ((strlen= tvb_length_remaining(tvb, offset))) { + offset= mysql_dissect_server_status(tvb, offset, tree); + + /* 4.1+ protocol only: 2 bytes number of warnings */ + if (conn_data->clnt_caps & conn_data->srv_caps & MYSQL_CAPS_CU) { + if (tree) { + proto_tree_add_item(tree, hf_mysql_num_warn, tvb, + offset, 2, FALSE); + } offset+= 2; + } } /* optional: message string */ |