openssl/ssl
Gunnar Kudrjavets 4c9b0a0314 Initialize potentially uninitialized local variables
Compiling OpenSSL code with MSVC and /W4 results in a number of warnings.
One category of warnings is particularly interesting - C4701 (potentially
uninitialized local variable 'name' used). This warning pretty much means
that there's a code path which results in uninitialized variables being used
or returned. Depending on compiler, its options, OS, values in registers
and/or stack, the results can be nondeterministic. Cases like this are very
hard to debug so it's rational to fix these issues.

This patch contains a set of trivial fixes for all the C4701 warnings (just
initializing variables to 0 or NULL or appropriate error code) to make sure
that deterministic values will be returned from all the execution paths.

RT#3835

Signed-off-by: Matt Caswell <matt@openssl.org>

Matt's note: All of these appear to be bogus warnings, i.e. there isn't
actually a code path where an unitialised variable could be used - its just
that the compiler hasn't been able to figure that out from the logic. So
this commit is just about silencing spurious warnings.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-05-06 13:06:46 +01:00
..
record memset, memcpy, sizeof consistency fixes 2015-05-05 22:18:59 -04:00
bio_ssl.c memset, memcpy, sizeof consistency fixes 2015-05-05 22:18:59 -04:00
d1_both.c memset, memcpy, sizeof consistency fixes 2015-05-05 22:18:59 -04:00
d1_clnt.c Add more error state transitions (DTLS) 2015-05-05 19:45:59 +01:00
d1_lib.c memset, memcpy, sizeof consistency fixes 2015-05-05 22:18:59 -04:00
d1_meth.c Run util/openssl-format-source -v -c . 2015-01-22 09:20:09 +00:00
d1_msg.c memset, memcpy, sizeof consistency fixes 2015-05-05 22:18:59 -04:00
d1_srtp.c dead code cleanup: #if 0 in ssl 2015-02-06 10:52:12 -05:00
d1_srvr.c Add more error state transitions (DTLS) 2015-05-05 19:45:59 +01:00
install-ssl.com Remove SSL_TASK, the DECnet Based SSL Engine - addendum 2015-03-31 22:19:22 +02:00
kssl.c memset, memcpy, sizeof consistency fixes 2015-05-05 22:18:59 -04:00
kssl_lcl.h Run util/openssl-format-source -v -c . 2015-01-22 09:20:09 +00:00
Makefile make update 2015-05-05 09:06:27 +01:00
s3_both.c Sanity check the return from final_finish_mac 2015-04-30 23:12:39 +01:00
s3_cbc.c Add sanity check in ssl3_cbc_digest_record 2015-04-30 23:12:39 +01:00
s3_clnt.c memset, memcpy, sizeof consistency fixes 2015-05-05 22:18:59 -04:00
s3_enc.c memset, memcpy, sizeof consistency fixes 2015-05-05 22:18:59 -04:00
s3_lib.c Use safer sizeof variant in malloc 2015-05-04 15:00:13 -04:00
s3_meth.c Run util/openssl-format-source -v -c . 2015-01-22 09:20:09 +00:00
s3_msg.c Introduce the functions RECORD_LAYER_release, RECORD_LAYER_read_pending, and 2015-03-26 15:01:59 +00:00
s3_srvr.c memset, memcpy, sizeof consistency fixes 2015-05-05 22:18:59 -04:00
s23_clnt.c free NULL cleanup -- coda 2015-05-01 14:37:16 -04:00
s23_lib.c Run util/openssl-format-source -v -c . 2015-01-22 09:20:09 +00:00
s23_meth.c OPENSSL_NO_XXX cleanup: NO_TLS, NO_TLS1 2015-01-27 15:14:12 -05:00
s23_srvr.c Code style: space after 'if' 2015-04-16 13:44:59 -04:00
ssl-lib.com Remove SSL_TASK, the DECnet Based SSL Engine 2015-03-31 21:59:43 +02:00
ssl_algs.c Fix missing return value checks 2015-03-23 15:23:11 +00:00
ssl_asn1.c ssl/ssl_asn1.c: Fix typo introduced via cc5b6a03a3 2015-05-05 09:06:15 +01:00
ssl_cert.c memset, memcpy, sizeof consistency fixes 2015-05-05 22:18:59 -04:00
ssl_ciph.c memset, memcpy, sizeof consistency fixes 2015-05-05 22:18:59 -04:00
ssl_conf.c Use safer sizeof variant in malloc 2015-05-04 15:00:13 -04:00
ssl_err.c Repair EAP-FAST session resumption 2015-04-21 18:12:58 +02:00
ssl_err2.c Run util/openssl-format-source -v -c . 2015-01-22 09:20:09 +00:00
ssl_lib.c memset, memcpy, sizeof consistency fixes 2015-05-05 22:18:59 -04:00
ssl_locl.h Sanity check the return from final_finish_mac 2015-04-30 23:12:39 +01:00
ssl_rsa.c free NULL cleanup -- coda 2015-05-01 14:37:16 -04:00
ssl_sess.c memset, memcpy, sizeof consistency fixes 2015-05-05 22:18:59 -04:00
ssl_stat.c Add Error state 2015-05-05 19:45:17 +01:00
ssl_txt.c Code style: space after 'if' 2015-04-16 13:44:59 -04:00
ssl_utst.c Run util/openssl-format-source -v -c . 2015-01-22 09:20:09 +00:00
t1_clnt.c Run util/openssl-format-source -v -c . 2015-01-22 09:20:09 +00:00
t1_enc.c Use safer sizeof variant in malloc 2015-05-04 15:00:13 -04:00
t1_ext.c memset, memcpy, sizeof consistency fixes 2015-05-05 22:18:59 -04:00
t1_lib.c Initialize potentially uninitialized local variables 2015-05-06 13:06:46 +01:00
t1_meth.c Run util/openssl-format-source -v -c . 2015-01-22 09:20:09 +00:00
t1_reneg.c Run util/openssl-format-source -v -c . 2015-01-22 09:20:09 +00:00
t1_srvr.c Run util/openssl-format-source -v -c . 2015-01-22 09:20:09 +00:00
t1_trce.c Add OSSL_NELEM macro. 2015-05-03 12:53:08 +01:00
tls_srp.c free NULL cleanup 7 2015-04-30 21:37:06 -04:00