summaryrefslogtreecommitdiffstats
path: root/crypto/evp/p5_crpt.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/evp/p5_crpt.c')
-rw-r--r--crypto/evp/p5_crpt.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/crypto/evp/p5_crpt.c b/crypto/evp/p5_crpt.c
index 2d80c3416a..0cf7e9d45e 100644
--- a/crypto/evp/p5_crpt.c
+++ b/crypto/evp/p5_crpt.c
@@ -99,9 +99,9 @@ int PKCS5_PBE_keyivgen(EVP_CIPHER_CTX *cctx, const char *pass, int passlen,
/* Extract useful info from parameter */
pbuf = param->value.sequence->data;
- if (!(pbe = d2i_PBEPARAM (NULL, &pbuf,
- param->value.sequence->length))) {
- EVPerr(EVP_F_EVP_PKCS5_PBE_KEYIVGEN,EVP_R_DECODE_ERROR);
+ if (!param || (param->type = V_ASN1_SEQUENCE) ||
+ !(pbe = d2i_PBEPARAM (NULL, &pbuf, param->value.sequence->length))) {
+ EVPerr(EVP_F_PKCS5_PBE_KEYIVGEN,EVP_R_DECODE_ERROR);
return 0;
}