summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libcrypto/asn1/tasn_new.c5
-rw-r--r--src/lib/libcrypto/asn1/tasn_prn.c5
-rw-r--r--src/lib/libssl/src/crypto/asn1/tasn_new.c5
-rw-r--r--src/lib/libssl/src/crypto/asn1/tasn_prn.c5
4 files changed, 14 insertions, 6 deletions
diff --git a/src/lib/libcrypto/asn1/tasn_new.c b/src/lib/libcrypto/asn1/tasn_new.c
index cbc6bfc1d5..86b2b3facd 100644
--- a/src/lib/libcrypto/asn1/tasn_new.c
+++ b/src/lib/libcrypto/asn1/tasn_new.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: tasn_new.c,v 1.12 2015/02/14 13:32:46 jsing Exp $ */ 1/* $OpenBSD: tasn_new.c,v 1.13 2015/02/14 15:15:27 miod 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 */
@@ -351,7 +351,8 @@ ASN1_primitive_new(ASN1_VALUE **pval, const ASN1_ITEM *it)
351 351
352 default: 352 default:
353 str = ASN1_STRING_type_new(utype); 353 str = ASN1_STRING_type_new(utype);
354 if (it->itype == ASN1_ITYPE_MSTRING && str) 354 if (it != NULL && it->itype == ASN1_ITYPE_MSTRING &&
355 str != NULL)
355 str->flags |= ASN1_STRING_FLAG_MSTRING; 356 str->flags |= ASN1_STRING_FLAG_MSTRING;
356 *pval = (ASN1_VALUE *)str; 357 *pval = (ASN1_VALUE *)str;
357 break; 358 break;
diff --git a/src/lib/libcrypto/asn1/tasn_prn.c b/src/lib/libcrypto/asn1/tasn_prn.c
index 844960fc77..c9fde96789 100644
--- a/src/lib/libcrypto/asn1/tasn_prn.c
+++ b/src/lib/libcrypto/asn1/tasn_prn.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: tasn_prn.c,v 1.12 2015/02/07 13:19:15 doug Exp $ */ 1/* $OpenBSD: tasn_prn.c,v 1.13 2015/02/14 15:15:27 miod 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 */
@@ -301,7 +301,10 @@ asn1_item_print_ctx(BIO *out, ASN1_VALUE **fld, int indent, const ASN1_ITEM *it,
301 /* Print each field entry */ 301 /* Print each field entry */
302 for (i = 0, tt = it->templates; i < it->tcount; i++, tt++) { 302 for (i = 0, tt = it->templates; i < it->tcount; i++, tt++) {
303 const ASN1_TEMPLATE *seqtt; 303 const ASN1_TEMPLATE *seqtt;
304
304 seqtt = asn1_do_adb(fld, tt, 1); 305 seqtt = asn1_do_adb(fld, tt, 1);
306 if (seqtt == NULL)
307 return 0;
305 tmpfld = asn1_get_field_ptr(fld, seqtt); 308 tmpfld = asn1_get_field_ptr(fld, seqtt);
306 if (!asn1_template_print_ctx(out, tmpfld, indent + 2, 309 if (!asn1_template_print_ctx(out, tmpfld, indent + 2,
307 seqtt, pctx)) 310 seqtt, pctx))
diff --git a/src/lib/libssl/src/crypto/asn1/tasn_new.c b/src/lib/libssl/src/crypto/asn1/tasn_new.c
index cbc6bfc1d5..86b2b3facd 100644
--- a/src/lib/libssl/src/crypto/asn1/tasn_new.c
+++ b/src/lib/libssl/src/crypto/asn1/tasn_new.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: tasn_new.c,v 1.12 2015/02/14 13:32:46 jsing Exp $ */ 1/* $OpenBSD: tasn_new.c,v 1.13 2015/02/14 15:15:27 miod 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 */
@@ -351,7 +351,8 @@ ASN1_primitive_new(ASN1_VALUE **pval, const ASN1_ITEM *it)
351 351
352 default: 352 default:
353 str = ASN1_STRING_type_new(utype); 353 str = ASN1_STRING_type_new(utype);
354 if (it->itype == ASN1_ITYPE_MSTRING && str) 354 if (it != NULL && it->itype == ASN1_ITYPE_MSTRING &&
355 str != NULL)
355 str->flags |= ASN1_STRING_FLAG_MSTRING; 356 str->flags |= ASN1_STRING_FLAG_MSTRING;
356 *pval = (ASN1_VALUE *)str; 357 *pval = (ASN1_VALUE *)str;
357 break; 358 break;
diff --git a/src/lib/libssl/src/crypto/asn1/tasn_prn.c b/src/lib/libssl/src/crypto/asn1/tasn_prn.c
index 844960fc77..c9fde96789 100644
--- a/src/lib/libssl/src/crypto/asn1/tasn_prn.c
+++ b/src/lib/libssl/src/crypto/asn1/tasn_prn.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: tasn_prn.c,v 1.12 2015/02/07 13:19:15 doug Exp $ */ 1/* $OpenBSD: tasn_prn.c,v 1.13 2015/02/14 15:15:27 miod 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 */
@@ -301,7 +301,10 @@ asn1_item_print_ctx(BIO *out, ASN1_VALUE **fld, int indent, const ASN1_ITEM *it,
301 /* Print each field entry */ 301 /* Print each field entry */
302 for (i = 0, tt = it->templates; i < it->tcount; i++, tt++) { 302 for (i = 0, tt = it->templates; i < it->tcount; i++, tt++) {
303 const ASN1_TEMPLATE *seqtt; 303 const ASN1_TEMPLATE *seqtt;
304
304 seqtt = asn1_do_adb(fld, tt, 1); 305 seqtt = asn1_do_adb(fld, tt, 1);
306 if (seqtt == NULL)
307 return 0;
305 tmpfld = asn1_get_field_ptr(fld, seqtt); 308 tmpfld = asn1_get_field_ptr(fld, seqtt);
306 if (!asn1_template_print_ctx(out, tmpfld, indent + 2, 309 if (!asn1_template_print_ctx(out, tmpfld, indent + 2,
307 seqtt, pctx)) 310 seqtt, pctx))