Fix clang complaints about uninitialised variables.
authorRichard Levitte <levitte@openssl.org>
Mon, 7 Dec 2015 19:37:08 +0000 (20:37 +0100)
committerRichard Levitte <levitte@openssl.org>
Mon, 7 Dec 2015 19:37:08 +0000 (20:37 +0100)
Reviewed-by: Rich Salz <rsalz@openssl.org>
crypto/pkcs12/p12_key.c
crypto/srp/srp_lib.c
ssl/t1_enc.c

index 3efdd4a5c40dbaf30e90dc2bff97d503b22a5d5b..6963a9796ac7bc1070b3bd7024c101fca92db148 100644 (file)
@@ -104,12 +104,12 @@ int PKCS12_key_gen_uni(unsigned char *pass, int passlen, unsigned char *salt,
                        int saltlen, int id, int iter, int n,
                        unsigned char *out, const EVP_MD *md_type)
 {
                        int saltlen, int id, int iter, int n,
                        unsigned char *out, const EVP_MD *md_type)
 {
-    unsigned char *B, *D, *I, *p, *Ai;
+    unsigned char *B = NULL, *D = NULL, *I = NULL, *p = NULL, *Ai = NULL;
     int Slen, Plen, Ilen, Ijlen;
     int i, j, u, v;
     int ret = 0;
     int Slen, Plen, Ilen, Ijlen;
     int i, j, u, v;
     int ret = 0;
-    BIGNUM *Ij, *Bpl1;          /* These hold Ij and B + 1 */
-    EVP_MD_CTX *ctx;
+    BIGNUM *Ij = NULL, *Bpl1 = NULL; /* These hold Ij and B + 1 */
+    EVP_MD_CTX *ctx = NULL;
 #ifdef  DEBUG_KEYGEN
     unsigned char *tmpout = out;
     int tmpn = n;
 #ifdef  DEBUG_KEYGEN
     unsigned char *tmpout = out;
     int tmpn = n;
index 0a073b61e0b1f5fc2d902da4824c9c802ea823b5..4b0ae0d198537de76ed44d5f199909743f17b719 100644 (file)
@@ -106,9 +106,9 @@ BIGNUM *SRP_Calc_u(BIGNUM *A, BIGNUM *B, BIGNUM *N)
 {
     /* k = SHA1(PAD(A) || PAD(B) ) -- tls-srp draft 8 */
 
 {
     /* k = SHA1(PAD(A) || PAD(B) ) -- tls-srp draft 8 */
 
-    BIGNUM *u;
+    BIGNUM *u = NULL;
     unsigned char cu[SHA_DIGEST_LENGTH];
     unsigned char cu[SHA_DIGEST_LENGTH];
-    unsigned char *cAB;
+    unsigned char *cAB = NULL;
     EVP_MD_CTX *ctxt = NULL;
     int longN;
     if ((A == NULL) || (B == NULL) || (N == NULL))
     EVP_MD_CTX *ctxt = NULL;
     int longN;
     if ((A == NULL) || (B == NULL) || (N == NULL))
index 5889558d7eacba44dabdf44b19a53171fdb59441..2d96330e8220943ab6cc66507b16a765d6a88a29 100644 (file)
@@ -157,8 +157,8 @@ static int tls1_P_hash(const EVP_MD *md, const unsigned char *sec,
 {
     int chunk;
     size_t j;
 {
     int chunk;
     size_t j;
-    EVP_MD_CTX *ctx, *ctx_tmp, *ctx_init;
-    EVP_PKEY *mac_key;
+    EVP_MD_CTX *ctx = NULL, *ctx_tmp = NULL, *ctx_init = NULL;
+    EVP_PKEY *mac_key = NULL;
     unsigned char A1[EVP_MAX_MD_SIZE];
     size_t A1_len;
     int ret = 0;
     unsigned char A1[EVP_MAX_MD_SIZE];
     size_t A1_len;
     int ret = 0;