MySQL: fix assert when the Connect Attrs capability is set, but no attributes

From
<http://dev.mysql.com/doc/internals/en/connection-phase-packets.html#packet-Protocol::HandshakeResponse>
(emphasis mine):

Starting with MySQL 5.6.6 the client **may** send attributes if CLIENT_CONNECT_ATTRS is set:

Does this mean that the capability *may* be set, but the list of attributes can be empty?

Issue reported by Peter Wu

Ping-Bug:10351
Change-Id: Ib83c27f4a15341f791c443471d7a3bdbd942aef4
Reviewed-on: https://code.wireshark.org/review/6965
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Alexis La Goutte 2015-02-05 09:33:45 +01:00 committed by Anders Broman
parent 2bcd38fec4
commit fb9dc13fb6

View file

@ -1064,7 +1064,7 @@ mysql_dissect_login(tvbuff_t *tvb, packet_info *pinfo, int offset,
}
/* optional: connection attributes */
if (conn_data->clnt_caps_ext & MYSQL_CAPS_CA)
if (conn_data->clnt_caps_ext & MYSQL_CAPS_CA && tvb_reported_length_remaining(tvb, offset))
{
proto_tree *connattrs_tree;
int lenfle;