diff --git a/packets.go b/packets.go index 967dde35f..68f4378d8 100644 --- a/packets.go +++ b/packets.go @@ -188,9 +188,13 @@ func (mc *mysqlConn) readInitPacket() ([]byte, error) { // return //} //return errMalformPkt + return cipher, nil } - return cipher, nil + // make a memory safe copy of the cipher slice + var b [8]byte + copy(b[:], cipher) + return b[:], nil } // Client Authentication Packet