avoid uninit variable and unreachable code warnings

most of these warnings are not problems because of ample
use of abort() calls.  However, the large number of warnings
makes it difficult to identify real problems.  Initialize
the variables to shut up the compilers.

Change-Id: I8477c11b17c7b6a7d9074c721fdd2d7303b186a8
This commit is contained in:
Jeffrey Altman
2011-05-16 23:45:29 -04:00
committed by Jeffrey Altman
parent 36dcd37cc7
commit 6850d6a65f
36 changed files with 87 additions and 76 deletions

View File

@@ -90,7 +90,7 @@ send_supported_mechs (OM_uint32 *minor_status,
gss_buffer_t output_token)
{
NegotiationTokenWin nt;
size_t buf_len;
size_t buf_len = 0;
gss_buffer_desc data;
OM_uint32 ret;
@@ -132,8 +132,10 @@ send_supported_mechs (OM_uint32 *minor_status,
*minor_status = ret;
return GSS_S_FAILURE;
}
if (data.length != buf_len)
if (data.length != buf_len) {
abort();
UNREACHABLE(return GSS_S_FAILURE);
}
ret = gss_encapsulate_token(&data, GSS_SPNEGO_MECHANISM, output_token);
@@ -439,7 +441,7 @@ acceptor_complete(OM_uint32 * minor_status,
if (verify_mic || *get_mic) {
int eret;
size_t buf_len;
size_t buf_len = 0;
ASN1_MALLOC_ENCODE(MechTypeList,
mech_buf->value, mech_buf->length,
@@ -448,8 +450,10 @@ acceptor_complete(OM_uint32 * minor_status,
*minor_status = eret;
return GSS_S_FAILURE;
}
if (buf.length != buf_len)
if (buf.length != buf_len) {
abort();
UNREACHABLE(return GSS_S_FAILURE);
}
}
if (verify_mic) {

View File

@@ -392,7 +392,7 @@ spnego_reply
NegotiationToken resp;
gss_OID_desc mech;
int require_mic;
size_t buf_len;
size_t buf_len = 0;
gss_buffer_desc mic_buf, mech_buf;
gss_buffer_desc mech_output_token;
gssspnego_ctx ctx;
@@ -557,8 +557,10 @@ spnego_reply
*minor_status = ret;
return GSS_S_FAILURE;
}
if (mech_buf.length != buf_len)
if (mech_buf.length != buf_len) {
abort();
UNREACHABLE(return GSS_S_FAILURE);
}
if (resp.u.negTokenResp.mechListMIC == NULL) {
HEIMDAL_MUTEX_unlock(&ctx->ctx_id_mutex);