Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packets.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ func (mc *mysqlConn) writeOldAuthPacket(cipher []byte) error {

// Calculate the packet lenght and add a tailing 0
pktLen := len(scrambleBuff) + 1
data := mc.buf.takeSmallBuffer(pktLen + 4)
data := mc.buf.takeSmallBuffer(4 + pktLen)
if data == nil {
// can not take the buffer. Something must be wrong with the connection
errLog.Print(errBusyBuffer)
Expand All @@ -305,6 +305,7 @@ func (mc *mysqlConn) writeOldAuthPacket(cipher []byte) error {

// Add the scrambled password [null terminated string]
copy(data[4:], scrambleBuff)
data[4+pktLen-1] = 0x00

return mc.writePacket(data)
}
Expand Down