From: Douglas Bagnall Date: Wed, 21 Dec 2016 00:24:46 +0000 (+1300) Subject: ntlmssp: fix compilation with -O2 -fno-inline X-Git-Tag: talloc-2.1.9~215 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3ee56607db8b4fedd5d04f74de548ae7324686cd;p=thirdparty%2Fsamba.git ntlmssp: fix compilation with -O2 -fno-inline Without inlining the function, GCC doesn't know that gensec_ntlmssp->ntlmssp_state->role always has a valid value. With inlining, this is obviously redundant but GCC clearly knows enough to detect this and elide the default case. Signed-off-by: Douglas Bagnall Reviewed-by: Andrew Bartlett --- diff --git a/auth/ntlmssp/ntlmssp.c b/auth/ntlmssp/ntlmssp.c index 4abab88627a..3283c964470 100644 --- a/auth/ntlmssp/ntlmssp.c +++ b/auth/ntlmssp/ntlmssp.c @@ -107,6 +107,10 @@ static NTSTATUS gensec_ntlmssp_update_find(struct gensec_security *gensec_securi return NT_STATUS_INVALID_PARAMETER; } break; + default: + DEBUG(1, ("NTLMSSP state has invalid role %d\n", + gensec_ntlmssp->ntlmssp_state->role)); + return NT_STATUS_INVALID_PARAMETER; } } else { if (!msrpc_parse(gensec_ntlmssp->ntlmssp_state,