diff options
author | 2015-02-14 15:15:27 +0000 | |
---|---|---|
committer | 2015-02-14 15:15:27 +0000 | |
commit | c57a681281d90a77bdba6f631dbb650b5d2da6d6 (patch) | |
tree | 4ff8f2cf93c042b09893932d3d49c555a1fec9c3 /lib/libssl/src | |
parent | Potential NULL dereference in the error path; Coverity CID 21720 (diff) | |
download | wireguard-openbsd-c57a681281d90a77bdba6f631dbb650b5d2da6d6.tar.xz wireguard-openbsd-c57a681281d90a77bdba6f631dbb650b5d2da6d6.zip |
Possible NULL pointer dereferences. Coverity CID 21719, 21732.
ok doug@ jsing@
Diffstat (limited to 'lib/libssl/src')
-rw-r--r-- | lib/libssl/src/crypto/asn1/tasn_new.c | 5 | ||||
-rw-r--r-- | lib/libssl/src/crypto/asn1/tasn_prn.c | 5 |
2 files changed, 7 insertions, 3 deletions
diff --git a/lib/libssl/src/crypto/asn1/tasn_new.c b/lib/libssl/src/crypto/asn1/tasn_new.c index cbc6bfc1d59..86b2b3facdf 100644 --- a/lib/libssl/src/crypto/asn1/tasn_new.c +++ b/lib/libssl/src/crypto/asn1/tasn_new.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tasn_new.c,v 1.12 2015/02/14 13:32:46 jsing Exp $ */ +/* $OpenBSD: tasn_new.c,v 1.13 2015/02/14 15:15:27 miod Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2000. */ @@ -351,7 +351,8 @@ ASN1_primitive_new(ASN1_VALUE **pval, const ASN1_ITEM *it) default: str = ASN1_STRING_type_new(utype); - if (it->itype == ASN1_ITYPE_MSTRING && str) + if (it != NULL && it->itype == ASN1_ITYPE_MSTRING && + str != NULL) str->flags |= ASN1_STRING_FLAG_MSTRING; *pval = (ASN1_VALUE *)str; break; diff --git a/lib/libssl/src/crypto/asn1/tasn_prn.c b/lib/libssl/src/crypto/asn1/tasn_prn.c index 844960fc776..c9fde96789f 100644 --- a/lib/libssl/src/crypto/asn1/tasn_prn.c +++ b/lib/libssl/src/crypto/asn1/tasn_prn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tasn_prn.c,v 1.12 2015/02/07 13:19:15 doug Exp $ */ +/* $OpenBSD: tasn_prn.c,v 1.13 2015/02/14 15:15:27 miod Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2000. */ @@ -301,7 +301,10 @@ asn1_item_print_ctx(BIO *out, ASN1_VALUE **fld, int indent, const ASN1_ITEM *it, /* Print each field entry */ for (i = 0, tt = it->templates; i < it->tcount; i++, tt++) { const ASN1_TEMPLATE *seqtt; + seqtt = asn1_do_adb(fld, tt, 1); + if (seqtt == NULL) + return 0; tmpfld = asn1_get_field_ptr(fld, seqtt); if (!asn1_template_print_ctx(out, tmpfld, indent + 2, seqtt, pctx)) |