[PATCH] Implement a more abstracted kpasswd service

Jeremy Allison jra at samba.org
Tue Sep 13 16:10:03 UTC 2016


On Tue, Sep 13, 2016 at 10:38:36AM +0200, Andreas Schneider wrote:
> 
> This code leaks memory on error now :(
> 
> The attached patch addresses the issue.

Thanks - sorry for that. It was secure though :-).

Pushed.

> 
> 
> 	-- andreas

> From 828a42165f57bad36e0309b5e964c447584e70ac Mon Sep 17 00:00:00 2001
> From: Andreas Schneider <asn at samba.org>
> Date: Tue, 13 Sep 2016 10:25:07 +0200
> Subject: [PATCH] s4-kdc: Do not leak memory on error in
>  kpasswd_make_error_reply()
> 
> CID 1372874
> 
> Signed-off-by: Andreas Schneider <asn at samba.org>
> ---
>  source4/kdc/kpasswd-helper.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/source4/kdc/kpasswd-helper.c b/source4/kdc/kpasswd-helper.c
> index 996b318..6de2837 100644
> --- a/source4/kdc/kpasswd-helper.c
> +++ b/source4/kdc/kpasswd-helper.c
> @@ -54,11 +54,13 @@ bool kpasswd_make_error_reply(TALLOC_CTX *mem_ctx,
>  	 */
>  #ifndef SAMBA4_USES_HEIMDAL
>  	if (slen < 2) {
> +		talloc_free(s);
>  		return false;
>  	}
>  	slen -= 2;
>  #endif
>  	if (2 + slen < slen) {
> +		talloc_free(s);
>  		return false;
>  	}
>  	error_data->length = 2 + slen;
> -- 
> 2.7.4
> 




More information about the samba-technical mailing list