Skip to content

Commit fd85cc8

Browse files
committed
Actually zero out the bytes in the HandshakeResponse320
: The specification says these bytes should be zero but the current implementation simply ignores them. Since takeSmallBuffer ends up reusing a buffer for this packet the values might not be all zeros.
1 parent 527bcd5 commit fd85cc8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packets.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,10 @@ func (mc *mysqlConn) writeAuthPacket(cipher []byte) error {
282282
}
283283

284284
// Filler [23 bytes] (all 0x00)
285-
pos := 13 + 23
285+
pos := 13
286+
for ; pos < 13+23; pos++ {
287+
data[pos] = 0
288+
}
286289

287290
// User [null terminated string]
288291
if len(mc.cfg.user) > 0 {

0 commit comments

Comments
 (0)