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

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

index 910f9b4..30096a0 100644 (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:
index 11a90f7..6a76a96 100644 (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: