Skip to content

Commit 50cba95

Browse files
kratkyzobakmethane
authored andcommitted
Fix auth errors when username/password are too long (go-sql-driver#1482) (go-sql-driver#1625)
1 parent ef734e4 commit 50cba95

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

Diff for: AUTHORS

+1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ ICHINOSE Shogo <shogo82148 at gmail.com>
5151
Ilia Cimpoes <ichimpoesh at gmail.com>
5252
INADA Naoki <songofacandy at gmail.com>
5353
Jacek Szwec <szwec.jacek at gmail.com>
54+
Jakub Adamus <kratky at zobak.cz>
5455
James Harr <james.harr at gmail.com>
5556
Janek Vedock <janekvedock at comcast.net>
5657
Jason Ng <oblitorum at gmail.com>

Diff for: packets.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ func (mc *mysqlConn) writeHandshakeResponsePacket(authResp []byte, plugin string
386386
// http://dev.mysql.com/doc/internals/en/connection-phase-packets.html#packet-Protocol::AuthSwitchResponse
387387
func (mc *mysqlConn) writeAuthSwitchPacket(authData []byte) error {
388388
pktLen := 4 + len(authData)
389-
data, err := mc.buf.takeSmallBuffer(pktLen)
389+
data, err := mc.buf.takeBuffer(pktLen)
390390
if err != nil {
391391
// cannot take the buffer. Something must be wrong with the connection
392392
mc.cleanup()

0 commit comments

Comments
 (0)