From f62f523d2458d82587f03e9357396a9c8a93fcba Mon Sep 17 00:00:00 2001 From: KratkyZobak Date: Mon, 11 Nov 2024 03:14:49 +0100 Subject: [PATCH] Fix auth errors when username/password are too long (#1482) (#1625) --- AUTHORS | 1 + packets.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/AUTHORS b/AUTHORS index 287176fb..a9860850 100644 --- a/AUTHORS +++ b/AUTHORS @@ -51,6 +51,7 @@ ICHINOSE Shogo Ilia Cimpoes INADA Naoki Jacek Szwec +Jakub Adamus James Harr Janek Vedock Jason Ng diff --git a/packets.go b/packets.go index 014a1dee..eb4e0cef 100644 --- a/packets.go +++ b/packets.go @@ -392,7 +392,7 @@ func (mc *mysqlConn) writeHandshakeResponsePacket(authResp []byte, plugin string // http://dev.mysql.com/doc/internals/en/connection-phase-packets.html#packet-Protocol::AuthSwitchResponse func (mc *mysqlConn) writeAuthSwitchPacket(authData []byte) error { pktLen := 4 + len(authData) - data, err := mc.buf.takeSmallBuffer(pktLen) + data, err := mc.buf.takeBuffer(pktLen) if err != nil { // cannot take the buffer. Something must be wrong with the connection mc.log(err)