From: Dr. Stephen Henson Date: Tue, 5 Nov 2002 13:49:04 +0000 (+0000) Subject: Check for NULL ASN1_ITEM when initializeing X-Git-Tag: OpenSSL_0_9_7-beta4~85 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=8d699c8c9394502be6e8dfb248ce834dee071f51;p=oweals%2Fopenssl.git Check for NULL ASN1_ITEM when initializeing boolean option in ASN1_TYPE. --- diff --git a/crypto/asn1/tasn_fre.c b/crypto/asn1/tasn_fre.c index c7610776f2..2dd844159e 100644 --- a/crypto/asn1/tasn_fre.c +++ b/crypto/asn1/tasn_fre.c @@ -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: diff --git a/crypto/asn1/tasn_new.c b/crypto/asn1/tasn_new.c index e33861f864..a0e3db574f 100644 --- a/crypto/asn1/tasn_new.c +++ b/crypto/asn1/tasn_new.c @@ -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: