[PATCH] The build with MIT KRB5 doesn't compile after process_prefork has been added

Jeremy Allison jra at samba.org
Thu Oct 19 18:28:24 UTC 2017


On Thu, Oct 19, 2017 at 05:37:41PM +0200, Andreas Schneider via samba-technical wrote:
> Hi,
> 
> the attached patch fixes building Samba with MIT Kerberos. The pointer for 
> model_ops is uninitialized.
> 
> error: ‘model_ops’ may be used uninitialized in this function [-Werror=maybe-
> uninitialized]
> 
> We have in the README.Coding that pointers should be *ALWAYS* initialized!!
> 
> 
> Please review and push if OK.

RB+. Obvious goodness. We should move towards
enabling compiler switches that force *all* auto
variables to be initialized.


> 
> 	Andreas
> 
> -- 
> Andreas Schneider                   GPG-ID: CC014E3D
> www.cryptomilk.org                asn at cryptomilk.org

> From a0e0ce4165267a9f392ccc28c39696d95571b461 Mon Sep 17 00:00:00 2001
> From: Andreas Schneider <asn at samba.org>
> Date: Thu, 19 Oct 2017 17:32:15 +0200
> Subject: [PATCH] s4:kdc: Initilaize pointer of kdc-service-mit
> MIME-Version: 1.0
> Content-Type: text/plain; charset=UTF-8
> Content-Transfer-Encoding: 8bit
> 
> error: ‘model_ops’ may be used uninitialized in this function
> [-Werror=maybe-uninitialized]
> 
> Signed-off-by: Andreas Schneider <asn at samba.org>
> ---
>  source4/kdc/kdc-service-mit.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/source4/kdc/kdc-service-mit.c b/source4/kdc/kdc-service-mit.c
> index 53997d5473d..e6499643e50 100644
> --- a/source4/kdc/kdc-service-mit.c
> +++ b/source4/kdc/kdc-service-mit.c
> @@ -58,7 +58,7 @@ static NTSTATUS startup_kpasswd_server(TALLOC_CTX *mem_ctx,
>  				       struct loadparm_context *lp_ctx,
>  				       struct interface *ifaces)
>  {
> -	const struct model_ops *model_ops;
> +	const struct model_ops *model_ops = NULL;
>  	int num_interfaces;
>  	int i;
>  	TALLOC_CTX *tmp_ctx;
> -- 
> 2.14.2
> 




More information about the samba-technical mailing list