X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=crypto%2Fasn1%2Ftasn_prn.c;h=5314c61b24918d7610339ffe8b5901b7f51093ee;hb=64b25758edca688a30f02c260262150f7ad0bc7d;hp=2626de9728e74dda0b3fd1e1d567ebdb4bdf8eca;hpb=34a7ed0c39aa3ab67eea1e106577525eaf0d7a00;p=thirdparty%2Fopenssl.git diff --git a/crypto/asn1/tasn_prn.c b/crypto/asn1/tasn_prn.c index 2626de9728..5314c61b24 100644 --- a/crypto/asn1/tasn_prn.c +++ b/crypto/asn1/tasn_prn.c @@ -58,13 +58,14 @@ */ #include -#include "cryptlib.h" +#include "internal/cryptlib.h" #include #include #include #include #include #include +#include "internal/asn1_int.h" #include "asn1_locl.h" /* @@ -84,16 +85,12 @@ ASN1_PCTX default_pctx = { ASN1_PCTX *ASN1_PCTX_new(void) { ASN1_PCTX *ret; - ret = OPENSSL_malloc(sizeof(ASN1_PCTX)); + + ret = OPENSSL_zalloc(sizeof(*ret)); if (ret == NULL) { ASN1err(ASN1_F_ASN1_PCTX_NEW, ERR_R_MALLOC_FAILURE); return NULL; } - ret->flags = 0; - ret->nm_flags = 0; - ret->cert_flags = 0; - ret->oid_flags = 0; - ret->str_flags = 0; return ret; } @@ -220,6 +217,7 @@ static int asn1_item_print_ctx(BIO *out, ASN1_VALUE **fld, int indent, if (!asn1_template_print_ctx(out, fld, indent, it->templates, pctx)) return 0; + break; } /* fall thru */ case ASN1_ITYPE_MSTRING: @@ -285,7 +283,7 @@ static int asn1_item_print_ctx(BIO *out, ASN1_VALUE **fld, int indent, for (i = 0, tt = it->templates; i < it->tcount; i++, tt++) { const ASN1_TEMPLATE *seqtt; seqtt = asn1_do_adb(fld, tt, 1); - if(!seqtt) + if (!seqtt) return 0; tmpfld = asn1_get_field_ptr(fld, seqtt); if (!asn1_template_print_ctx(out, tmpfld,