summaryrefslogtreecommitdiffstats
path: root/crypto/x509v3/v3_asid.c
diff options
context:
space:
mode:
authorGunnar Kudrjavets <gunnarku@microsoft.com>2015-05-06 10:16:55 +0100
committerMatt Caswell <matt@openssl.org>2015-05-06 13:06:46 +0100
commit4c9b0a0314c8bab3c9faeac06d0aa734836b2f81 (patch)
tree5acabe389517b31d1d3d2dad29fdfac426a0165c /crypto/x509v3/v3_asid.c
parent4407d070e591cc8dc3f4b34779933f97cf2df222 (diff)
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>
Diffstat (limited to 'crypto/x509v3/v3_asid.c')
-rw-r--r--crypto/x509v3/v3_asid.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/x509v3/v3_asid.c b/crypto/x509v3/v3_asid.c
index d7f58486fb..26ca15844b 100644
--- a/crypto/x509v3/v3_asid.c
+++ b/crypto/x509v3/v3_asid.c
@@ -553,7 +553,7 @@ static void *v2i_ASIdentifiers(const struct v3_ext_method *method,
for (i = 0; i < sk_CONF_VALUE_num(values); i++) {
CONF_VALUE *val = sk_CONF_VALUE_value(values, i);
- int i1, i2, i3, is_range, which;
+ int i1 = 0, i2 = 0, i3 = 0, is_range = 0, which = 0;
/*
* Figure out whether this is an AS or an RDI.