Check for NULL ASN1_ITEM when initializeing

boolean option in ASN1_TYPE.
This commit is contained in:
Dr. Stephen Henson 2002-11-05 13:48:33 +00:00
parent 5e3247d8bc
commit 38c7271a39
2 changed files with 8 additions and 2 deletions

View File

@ -207,7 +207,10 @@ void ASN1_primitive_free(ASN1_VALUE **pval, const ASN1_ITEM *it)
break;
case V_ASN1_BOOLEAN:
*(ASN1_BOOLEAN *)pval = it->size;
if (it)
*(ASN1_BOOLEAN *)pval = it->size;
else
*(ASN1_BOOLEAN *)pval = -1;
return;
case V_ASN1_NULL:

View File

@ -307,7 +307,10 @@ int ASN1_primitive_new(ASN1_VALUE **pval, const ASN1_ITEM *it)
return 1;
case V_ASN1_BOOLEAN:
*(ASN1_BOOLEAN *)pval = it->size;
if (it)
*(ASN1_BOOLEAN *)pval = it->size;
else
*(ASN1_BOOLEAN *)pval = -1;
return 1;
case V_ASN1_NULL: