Skip to content

Commit

Permalink
Update mongo/options/clientoptions.go
Browse files Browse the repository at this point in the history
Co-authored-by: Matt Dale <9760375+matthewdale@users.noreply.github.com>
  • Loading branch information
blink1073 and matthewdale authored Jun 28, 2024
1 parent 1c6eb28 commit 194b9bd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mongo/options/clientoptions.go
Original file line number Diff line number Diff line change
Expand Up @@ -1175,11 +1175,11 @@ func addClientCertFromSeparateFiles(cfg *tls.Config, keyFile, certFile, keyPassw
if certSize > 64*1024*1024 {
return "", errors.New("X.509 certificate must be less than 64 MiB")
}
dataSize := keySize + certSize + 1
dataSize := int64(keySize) + int64(certSize) + 1
if dataSize > math.MaxInt {
return "", errors.New("size overflow")
}
data := make([]byte, 0, dataSize)
data := make([]byte, 0, int(dataSize))
data = append(data, keyData...)
data = append(data, '\n')
data = append(data, certData...)
Expand Down

0 comments on commit 194b9bd

Please sign in to comment.