Skip to content

Commit db2f3d2

Browse files
committed
pluggable auth: server should escape '\0' too, it's OK packet
1 parent cb7978a commit db2f3d2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sql/sql_acl.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14196,11 +14196,11 @@ static int server_mpvio_write_packet(MYSQL_PLUGIN_VIO *param,
1419614196
res= send_server_handshake_packet(mpvio, (char*) packet, packet_len);
1419714197
else if (mpvio->status == MPVIO_EXT::RESTART)
1419814198
res= send_plugin_request_packet(mpvio, packet, packet_len);
14199-
else if (packet_len > 0 && (*packet == 1 || *packet == 255 || *packet == 254))
14199+
else if (packet_len > 0 && (*packet < 2 || *packet > 253))
1420014200
{
1420114201
/*
14202-
we cannot allow plugin data packet to start from 255 or 254 -
14203-
as the client will treat it as an error or "change plugin" packet.
14202+
we cannot allow plugin data packet to start from 0, 255 or 254 -
14203+
as the client will treat it as an OK, ERROR or "change plugin" packet.
1420414204
We'll escape these bytes with \1. Consequently, we
1420514205
have to escape \1 byte too.
1420614206
*/

0 commit comments

Comments
 (0)