/* Extract useful info from parameter */
pbuf = param->value.sequence->data;
- if (!(pbe = d2i_PBEPARAM (NULL, &pbuf,
- param->value.sequence->length))) {
+ if (!param || (param->type = V_ASN1_SEQUENCE) ||
+ !(pbe = d2i_PBEPARAM (NULL, &pbuf, param->value.sequence->length))) {
EVPerr(PKCS12_F_PKCS12_PBE_KEYIVGEN,EVP_R_DECODE_ERROR);
return 0;
}