Skip to content

Commit

Permalink
Merge pull request #8 from Pirayya/bugfix/int-overflow-on-x86-arch
Browse files Browse the repository at this point in the history
fixed overflow issue for x86 archs
  • Loading branch information
Pavel Chernykh authored Feb 13, 2018
2 parents caa8a2e + 04a6ef2 commit 7bbcda7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions encoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func (kse *keyStoreEncoder) writeCertificate(cert *Certificate) error {
if err != nil {
return err
}
certLen := len(cert.Content)
certLen := uint64(len(cert.Content))
if certLen > math.MaxUint32 {
return ErrEncodedSequenceTooLong
}
Expand Down Expand Up @@ -149,7 +149,7 @@ func (kse *keyStoreEncoder) writePrivateKeyEntry(alias string, pke *PrivateKeyEn
if err != nil {
return err
}
privKeyLen := len(encodedPrivKeyContent)
privKeyLen := uint64(len(encodedPrivKeyContent))
if privKeyLen > math.MaxUint32 {
return ErrEncodedSequenceTooLong
}
Expand All @@ -161,7 +161,7 @@ func (kse *keyStoreEncoder) writePrivateKeyEntry(alias string, pke *PrivateKeyEn
if err != nil {
return err
}
certCount := len(pke.CertChain)
certCount := uint64(len(pke.CertChain))
if certCount > math.MaxUint32 {
return ErrEncodedSequenceTooLong
}
Expand Down

0 comments on commit 7bbcda7

Please sign in to comment.