summaryrefslogtreecommitdiff
path: root/crypto
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2002-11-05 13:48:33 +0000
committerDr. Stephen Henson <steve@openssl.org>2002-11-05 13:48:33 +0000
commit38c7271a39224cf91b9c6452e3c1107df932d750 (patch)
treef597c90456bc5ea34ca03f0769cca2982b403f95 /crypto
parent5e3247d8bcbf0da783f182633f0c123e7d88e8b6 (diff)
downloadopenssl-new-38c7271a39224cf91b9c6452e3c1107df932d750.tar.gz
Check for NULL ASN1_ITEM when initializeing
boolean option in ASN1_TYPE.
Diffstat (limited to 'crypto')
-rw-r--r--crypto/asn1/tasn_fre.c5
-rw-r--r--crypto/asn1/tasn_new.c5
2 files changed, 8 insertions, 2 deletions
diff --git a/crypto/asn1/tasn_fre.c b/crypto/asn1/tasn_fre.c
index 910f9b4f26..30096a0bcf 100644
--- a/crypto/asn1/tasn_fre.c
+++ b/crypto/asn1/tasn_fre.c
@@ -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:
diff --git a/crypto/asn1/tasn_new.c b/crypto/asn1/tasn_new.c
index 11a90f739e..6a76a96ba9 100644
--- a/crypto/asn1/tasn_new.c
+++ b/crypto/asn1/tasn_new.c
@@ -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: