fix taking address of first element of empty byte slice

Change-Id: I57efec6116b688bf1aaa5da34280f76a0d9ec882
This commit is contained in:
Andrew Harding 2014-05-22 16:49:27 -06:00
parent 4eb00a0087
commit 11f8f384f4

View File

@ -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",
@ -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",