Skip to content

Commit

Permalink
fix taking address of first element of empty byte slice
Browse files Browse the repository at this point in the history
Change-Id: I57efec6116b688bf1aaa5da34280f76a0d9ec882
  • Loading branch information
Andrew Harding committed Jun 30, 2014
1 parent 4eb00a0 commit 11f8f38
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ciphers_gcm.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func NewGCMEncryptionCipherCtx(blocksize int, e *Engine, key, iv []byte) (
if err != nil {
return nil, err
}
if iv != nil {
if len(iv) > 0 {
err := ctx.setCtrl(C.EVP_CTRL_GCM_SET_IVLEN, len(iv))
if err != nil {
return nil, fmt.Errorf("could not set IV len to %d: %s",
Expand All @@ -106,7 +106,7 @@ func NewGCMDecryptionCipherCtx(blocksize int, e *Engine, key, iv []byte) (
if err != nil {
return nil, err
}
if iv != nil {
if len(iv) > 0 {
err := ctx.setCtrl(C.EVP_CTRL_GCM_SET_IVLEN, len(iv))
if err != nil {
return nil, fmt.Errorf("could not set IV len to %d: %s",
Expand Down

0 comments on commit 11f8f38

Please sign in to comment.