summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/asn1/tasn_enc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/asn1/tasn_enc.c')
-rw-r--r--src/lib/libcrypto/asn1/tasn_enc.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/lib/libcrypto/asn1/tasn_enc.c b/src/lib/libcrypto/asn1/tasn_enc.c
index f3341901fe..d103c4d096 100644
--- a/src/lib/libcrypto/asn1/tasn_enc.c
+++ b/src/lib/libcrypto/asn1/tasn_enc.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: tasn_enc.c,v 1.21 2016/12/30 16:04:34 jsing Exp $ */ 1/* $OpenBSD: tasn_enc.c,v 1.22 2019/04/01 15:48:04 jsing Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 2000. 3 * project 2000.
4 */ 4 */
@@ -541,11 +541,14 @@ asn1_ex_i2c(ASN1_VALUE **pval, unsigned char *cout, int *putype,
541 const unsigned char *cont; 541 const unsigned char *cont;
542 unsigned char c; 542 unsigned char c;
543 int len; 543 int len;
544 const ASN1_PRIMITIVE_FUNCS *pf;
545 544
546 pf = it->funcs; 545 if (it->funcs != NULL) {
547 if (pf && pf->prim_i2c) 546 const ASN1_PRIMITIVE_FUNCS *pf = it->funcs;
547
548 if (pf->prim_i2c == NULL)
549 return -1;
548 return pf->prim_i2c(pval, cout, putype, it); 550 return pf->prim_i2c(pval, cout, putype, it);
551 }
549 552
550 /* Should type be omitted? */ 553 /* Should type be omitted? */
551 if ((it->itype != ASN1_ITYPE_PRIMITIVE) || 554 if ((it->itype != ASN1_ITYPE_PRIMITIVE) ||