Check for NULL ASN1_ITEM when initializeing
authorDr. Stephen Henson <steve@openssl.org>
Tue, 5 Nov 2002 13:49:04 +0000 (13:49 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Tue, 5 Nov 2002 13:49:04 +0000 (13:49 +0000)
boolean option in ASN1_TYPE.

crypto/asn1/tasn_fre.c
crypto/asn1/tasn_new.c

index c7610776f251437a1c163db568360e1706e5b142..2dd844159ebe3d5d956cca8b9125a11b9053bfd9 100644 (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:
index e33861f864ae0feca4e6b33c723d50a97fad7902..a0e3db574f2d60c819e24b3422589972e74cf668 100644 (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: