summaryrefslogtreecommitdiff
path: root/crypto/evp/evp_lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/evp/evp_lib.c')
-rw-r--r--crypto/evp/evp_lib.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/crypto/evp/evp_lib.c b/crypto/evp/evp_lib.c
index 69784eb555..729fc8f4e6 100644
--- a/crypto/evp/evp_lib.c
+++ b/crypto/evp/evp_lib.c
@@ -97,7 +97,10 @@ ASN1_TYPE *type;
{
l=EVP_CIPHER_CTX_iv_length(c);
i=ASN1_TYPE_get_octetstring(type,c->oiv,l);
- memcpy(c->iv,c->oiv,l);
+ if (i != l)
+ return(-1);
+ else if (i > 0)
+ memcpy(c->iv,c->oiv,l);
}
return(i);
}