Skip to content

Commit 36b3789

Browse files
committed
Merge pull request #29 from wangjild/master
conn.salt contain "\0" not match the protocal specification
2 parents 9dea852 + d413988 commit 36b3789

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

mysql/util.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@ func RandomBuf(size int) ([]byte, error) {
5252
return nil, err
5353
}
5454

55+
// avoid to generate '\0'
56+
for i, b := range buf {
57+
if uint8(b) == 0 {
58+
buf[i] = '0'
59+
}
60+
}
5561
return buf, nil
5662
}
5763

0 commit comments

Comments
 (0)