diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2005-07-26 12:25:06 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2005-07-26 12:25:06 +0000 |
commit | 5c8e9139d18ca20fd4a6f194697d2e2634009cca (patch) | |
tree | d251904d8e3ba76f2814d953b31e6ce97e3dd7a1 /crypto/asn1/tasn_new.c | |
parent | 56defd9a98c0c8b765c7744d4266db2e98c4f80c (diff) |
Handle case where it==NULL
Diffstat (limited to 'crypto/asn1/tasn_new.c')
-rw-r--r-- | crypto/asn1/tasn_new.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/crypto/asn1/tasn_new.c b/crypto/asn1/tasn_new.c index 9216342fec..531dad365c 100644 --- a/crypto/asn1/tasn_new.c +++ b/crypto/asn1/tasn_new.c @@ -326,11 +326,13 @@ int ASN1_primitive_new(ASN1_VALUE **pval, const ASN1_ITEM *it) { ASN1_TYPE *typ; int utype; - const ASN1_PRIMITIVE_FUNCS *pf; - pf = it->funcs; - if (pf && pf->prim_new) - return pf->prim_new(pval, it); + if (it && it->funcs) + { + const ASN1_PRIMITIVE_FUNCS *pf = it->funcs; + if (pf->prim_new) + return pf->prim_new(pval, it); + } if (!it || (it->itype == ASN1_ITYPE_MSTRING)) utype = -1; @@ -374,10 +376,9 @@ int ASN1_primitive_new(ASN1_VALUE **pval, const ASN1_ITEM *it) void asn1_primitive_clear(ASN1_VALUE **pval, const ASN1_ITEM *it) { int utype; - const ASN1_PRIMITIVE_FUNCS *pf; - pf = it->funcs; - if (pf) + if (it && it->funcs) { + const ASN1_PRIMITIVE_FUNCS *pf = it->funcs; if (pf->prim_clear) pf->prim_clear(pval, it); else |