Check for NULL ASN1_ITEM when initializeing

boolean option in ASN1_TYPE.
This commit is contained in:
Dr. Stephen Henson 2002-11-05 13:49:04 +00:00
parent e2a93e38d6
commit 8d699c8c93
2 changed files with 8 additions and 2 deletions

View file

@ -206,7 +206,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

@ -305,7 +305,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: