Fix some missing inits
authorFdaSilvaYY <fdasilvayy@gmail.com>
Sun, 6 Mar 2016 20:26:46 +0000 (21:26 +0100)
committerRich Salz <rsalz@openssl.org>
Tue, 31 May 2016 20:58:22 +0000 (16:58 -0400)
Backport of 8e89e85f556f549f05d3b49f5408a217ac5e3700
From PR #1019 / #997

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1019)

crypto/asn1/a_strnid.c
crypto/asn1/bio_asn1.c
crypto/asn1/bio_ndef.c
crypto/bio/bss_bio.c

index 52243453689aa27b3b9d3a3c5f260a26c8d6ed7e..2d2303d8599e7abfa41204f323a20d443fb1604d 100644 (file)
@@ -250,6 +250,7 @@ int ASN1_STRING_TABLE_add(int nid,
         }
         tmp->flags = flags | STABLE_FLAGS_MALLOC;
         tmp->nid = nid;
+        tmp->minsize = tmp->maxsize = -1;
         new_nid = 1;
     } else
         tmp->flags = (tmp->flags & STABLE_FLAGS_MALLOC) | flags;
index 60189b3b2c535b07e2aa6977ffc71b4becc8c157..c3afff69dc7e72ab05b1ef48f06680c8be08c60a 100644 (file)
@@ -170,10 +170,12 @@ static int asn1_bio_init(BIO_ASN1_BUF_CTX *ctx, int size)
     ctx->copylen = 0;
     ctx->asn1_class = V_ASN1_UNIVERSAL;
     ctx->asn1_tag = V_ASN1_OCTET_STRING;
-    ctx->ex_buf = 0;
-    ctx->ex_pos = 0;
+    ctx->ex_buf = NULL;
     ctx->ex_len = 0;
+    ctx->ex_pos = 0;
     ctx->state = ASN1_STATE_START;
+    ctx->prefix = ctx->prefix_free = ctx->suffix = ctx->suffix_free = NULL;
+    ctx->ex_arg = NULL;
     return 1;
 }
 
index 31949b87940fa5af84a907ffac1516073645e439..8d7046633cfe74ecc015190447d49a1d599a5bfb 100644 (file)
@@ -136,6 +136,7 @@ BIO *BIO_new_NDEF(BIO *out, ASN1_VALUE *val, const ASN1_ITEM *it)
     ndef_aux->ndef_bio = sarg.ndef_bio;
     ndef_aux->boundary = sarg.boundary;
     ndef_aux->out = out;
+    ndef_aux->derbuf = NULL;
 
     BIO_ctrl(asn_bio, BIO_C_SET_EX_ARG, 0, ndef_aux);
 
index 202cc3615d54205ce39bcf356ea531a5240199ee..3dd818772942c2075be4934c4c795e75477e01da 100644 (file)
@@ -149,9 +149,13 @@ static int bio_new(BIO *bio)
         return 0;
 
     b->peer = NULL;
+    b->closed = 0;
+    b->len = 0;
+    b->offset = 0;
     /* enough for one TLS record (just a default) */
     b->size = 17 * 1024;
     b->buf = NULL;
+    b->request = 0;
 
     bio->ptr = b;
     return 1;