diff options
author | Matt Lawrence <bugzilla.wireshark@erisa.co.uk> | 2016-08-29 11:39:04 +0100 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2016-09-11 17:24:36 +0000 |
commit | bb46efdca9c9e710a511501652e27dc3606c6e5f (patch) | |
tree | 2ba881d52d4936dfb4828aaea951b049196f9714 /epan/dissectors/packet-mysql.c | |
parent | c31527d406e57e9e86699b9cfe2059300f911cf1 (diff) |
MySQL: verify connection state before dissecting as greeting/login.
Change-Id: I419fad047c91ff1d8544eb3458534c132ec23821
Bug: 12791
Reviewed-on: https://code.wireshark.org/review/17368
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-mysql.c')
-rw-r--r-- | epan/dissectors/packet-mysql.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/epan/dissectors/packet-mysql.c b/epan/dissectors/packet-mysql.c index f64590519a..9ccbfb15d7 100644 --- a/epan/dissectors/packet-mysql.c +++ b/epan/dissectors/packet-mysql.c @@ -2312,7 +2312,7 @@ dissect_mysql_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* dat is_ssl = proto_is_frame_protocol(pinfo->layers, "ssl"); if (is_response) { - if (packet_number == 0 ) { + if (packet_number == 0 && mysql_frame_data_p->state == UNDEFINED) { col_set_str(pinfo->cinfo, COL_INFO, "Server Greeting"); offset = mysql_dissect_greeting(tvb, pinfo, offset, mysql_tree, conn_data); } else { @@ -2320,7 +2320,7 @@ dissect_mysql_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* dat offset = mysql_dissect_response(tvb, pinfo, offset, mysql_tree, conn_data); } } else { - if (packet_number == 1 || (packet_number == 2 && is_ssl)) { + if (mysql_frame_data_p->state == LOGIN && (packet_number == 1 || (packet_number == 2 && is_ssl))) { col_set_str(pinfo->cinfo, COL_INFO, "Login Request"); offset = mysql_dissect_login(tvb, pinfo, offset, mysql_tree, conn_data); if (conn_data->srv_caps & MYSQL_CAPS_CP) { |