mirror of
https://github.com/openssl/openssl.git
synced 2025-01-18 13:44:20 +08:00
Fix some missing inits
Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/997)
This commit is contained in:
parent
8640f21093
commit
8e89e85f55
@ -213,6 +213,7 @@ static ASN1_STRING_TABLE *stable_get(int nid)
|
|||||||
rv->mask = tmp->mask;
|
rv->mask = tmp->mask;
|
||||||
rv->flags = tmp->flags | STABLE_FLAGS_MALLOC;
|
rv->flags = tmp->flags | STABLE_FLAGS_MALLOC;
|
||||||
} else {
|
} else {
|
||||||
|
rv->nid = NID_undef;
|
||||||
rv->minsize = -1;
|
rv->minsize = -1;
|
||||||
rv->maxsize = -1;
|
rv->maxsize = -1;
|
||||||
rv->mask = 0;
|
rv->mask = 0;
|
||||||
|
@ -96,6 +96,7 @@ const BIO_METHOD *BIO_f_asn1(void)
|
|||||||
static int asn1_bio_new(BIO *b)
|
static int asn1_bio_new(BIO *b)
|
||||||
{
|
{
|
||||||
BIO_ASN1_BUF_CTX *ctx;
|
BIO_ASN1_BUF_CTX *ctx;
|
||||||
|
|
||||||
ctx = OPENSSL_malloc(sizeof(*ctx));
|
ctx = OPENSSL_malloc(sizeof(*ctx));
|
||||||
if (ctx == NULL)
|
if (ctx == NULL)
|
||||||
return 0;
|
return 0;
|
||||||
@ -120,10 +121,12 @@ static int asn1_bio_init(BIO_ASN1_BUF_CTX *ctx, int size)
|
|||||||
ctx->copylen = 0;
|
ctx->copylen = 0;
|
||||||
ctx->asn1_class = V_ASN1_UNIVERSAL;
|
ctx->asn1_class = V_ASN1_UNIVERSAL;
|
||||||
ctx->asn1_tag = V_ASN1_OCTET_STRING;
|
ctx->asn1_tag = V_ASN1_OCTET_STRING;
|
||||||
ctx->ex_buf = 0;
|
ctx->ex_buf = NULL;
|
||||||
ctx->ex_pos = 0;
|
|
||||||
ctx->ex_len = 0;
|
ctx->ex_len = 0;
|
||||||
|
ctx->ex_pos = 0;
|
||||||
ctx->state = ASN1_STATE_START;
|
ctx->state = ASN1_STATE_START;
|
||||||
|
ctx->prefix = ctx->prefix_free = ctx->suffix = ctx->suffix_free = NULL;
|
||||||
|
ctx->ex_arg = NULL;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,6 +90,7 @@ BIO *BIO_new_NDEF(BIO *out, ASN1_VALUE *val, const ASN1_ITEM *it)
|
|||||||
ndef_aux->ndef_bio = sarg.ndef_bio;
|
ndef_aux->ndef_bio = sarg.ndef_bio;
|
||||||
ndef_aux->boundary = sarg.boundary;
|
ndef_aux->boundary = sarg.boundary;
|
||||||
ndef_aux->out = out;
|
ndef_aux->out = out;
|
||||||
|
ndef_aux->derbuf = NULL;
|
||||||
|
|
||||||
BIO_ctrl(asn_bio, BIO_C_SET_EX_ARG, 0, ndef_aux);
|
BIO_ctrl(asn_bio, BIO_C_SET_EX_ARG, 0, ndef_aux);
|
||||||
|
|
||||||
|
@ -25,12 +25,20 @@
|
|||||||
ASN1_SCTX *ASN1_SCTX_new(int (*scan_cb) (ASN1_SCTX *ctx))
|
ASN1_SCTX *ASN1_SCTX_new(int (*scan_cb) (ASN1_SCTX *ctx))
|
||||||
{
|
{
|
||||||
ASN1_SCTX *ret;
|
ASN1_SCTX *ret;
|
||||||
|
|
||||||
ret = OPENSSL_malloc(sizeof(*ret));
|
ret = OPENSSL_malloc(sizeof(*ret));
|
||||||
if (ret == NULL) {
|
if (ret == NULL) {
|
||||||
ASN1err(ASN1_F_ASN1_SCTX_NEW, ERR_R_MALLOC_FAILURE);
|
ASN1err(ASN1_F_ASN1_SCTX_NEW, ERR_R_MALLOC_FAILURE);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
ret->it = ret->tt = NULL;
|
||||||
|
ret->flags = 0;
|
||||||
|
ret->skidx = ret->depth = 0;
|
||||||
|
ret->sname = ret->fname = NULL;
|
||||||
|
ret->prim_type = 0;
|
||||||
|
ret->field = NULL;
|
||||||
ret->scan_cb = scan_cb;
|
ret->scan_cb = scan_cb;
|
||||||
|
ret->app_data = NULL;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -81,9 +81,13 @@ static int bio_new(BIO *bio)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
b->peer = NULL;
|
b->peer = NULL;
|
||||||
|
b->closed = 0;
|
||||||
|
b->len = 0;
|
||||||
|
b->offset = 0;
|
||||||
/* enough for one TLS record (just a default) */
|
/* enough for one TLS record (just a default) */
|
||||||
b->size = 17 * 1024;
|
b->size = 17 * 1024;
|
||||||
b->buf = NULL;
|
b->buf = NULL;
|
||||||
|
b->request = 0;
|
||||||
|
|
||||||
bio->ptr = b;
|
bio->ptr = b;
|
||||||
return 1;
|
return 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user