1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-08 21:18:16 +03:00

auth:gensec: Fully initialize struct spnego_data

"Error: UNINIT (CWE-457):
samba-4.20.0rc2/auth/gensec/spnego.c:1129: var_decl: Declaring variable ""spnego_out"" without initializer.
samba-4.20.0rc2/auth/gensec/spnego.c:1154: uninit_use_in_call: Using uninitialized value ""spnego_out.negTokenTarg.negResult"" when calling ""spnego_write_data"".
 1152|   	}
 1153|
 1154|-> 	if (spnego_write_data(out_mem_ctx, out, &spnego_out) == -1) {
 1155|   		DEBUG(1, (""Failed to write SPNEGO reply to NEG_TOKEN_TARG\n""));
 1156|   		return NT_STATUS_INVALID_PARAMETER;"

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
This commit is contained in:
Andreas Schneider 2024-07-16 17:01:22 +02:00 committed by Andreas Schneider
parent d64242f676
commit 8d637d667d

View File

@ -1110,13 +1110,12 @@ static NTSTATUS gensec_spnego_server_response(struct spnego_state *spnego_state,
DATA_BLOB mech_list_mic,
DATA_BLOB *out)
{
struct spnego_data spnego_out;
/* compose reply */
spnego_out.type = SPNEGO_NEG_TOKEN_TARG;
spnego_out.negTokenTarg.responseToken = unwrapped_out;
spnego_out.negTokenTarg.mechListMIC = mech_list_mic;
spnego_out.negTokenTarg.supportedMech = NULL;
struct spnego_data spnego_out = {
.type = SPNEGO_NEG_TOKEN_TARG,
.negTokenTarg.responseToken = unwrapped_out,
.negTokenTarg.mechListMIC = mech_list_mic,
.negTokenTarg.supportedMech = NULL,
};
if (NT_STATUS_EQUAL(nt_status, NT_STATUS_MORE_PROCESSING_REQUIRED)) {
spnego_out.negTokenTarg.supportedMech = spnego_state->neg_oid;