Skip to content

Commit

Permalink
Merge pull request siddontang#29 from wangjild/master
Browse files Browse the repository at this point in the history
conn.salt contain "\0" not match the protocal specification
  • Loading branch information
siddontang committed Dec 5, 2014
2 parents 9dea852 + d413988 commit 36b3789
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions mysql/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ func RandomBuf(size int) ([]byte, error) {
return nil, err
}

// avoid to generate '\0'
for i, b := range buf {
if uint8(b) == 0 {
buf[i] = '0'
}
}
return buf, nil
}

Expand Down

0 comments on commit 36b3789

Please sign in to comment.