From 80e71912394645b611db00976c876c66ef2a003a Mon Sep 17 00:00:00 2001 From: Jakub Adamus Date: Tue, 20 Aug 2024 14:52:08 +0200 Subject: [PATCH] fix auth errors when username/password are too long (#1482) --- 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 5ca6491a..890af222 100644 --- a/packets.go +++ b/packets.go @@ -394,7 +394,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)