[PATCH] Fix new Coverity IDs

Andreas Schneider asn at samba.org
Wed Jan 11 06:56:04 UTC 2017


On Tuesday, 10 January 2017 15:40:41 CET Jeremy Allison wrote:
> On Tue, Jan 10, 2017 at 09:03:08PM +0100, Volker Lendecke wrote:
> > Hi!
> > 
> > Review appreciated!
> > 
> > Thanks, Volker
> 
> First 5 - LGTM - pushed.
> 
> > From ce65b259cb8088a3665b062834ee969af5fbd895 Mon Sep 17 00:00:00 2001
> > From: Volker Lendecke <vl at samba.org>
> > Date: Tue, 10 Jan 2017 13:30:49 +0000
> > Subject: [PATCH 6/6] winbind: Fix CID 1398534 Dereference before null
> > check
> > 
> > Signed-off-by: Volker Lendecke <vl at samba.org>
> > ---
> > 
> >  source3/winbindd/winbindd_samr.c | 4 +---
> >  1 file changed, 1 insertion(+), 3 deletions(-)
> > 
> > diff --git a/source3/winbindd/winbindd_samr.c
> > b/source3/winbindd/winbindd_samr.c index 224f105..4f3730b 100644
> > --- a/source3/winbindd/winbindd_samr.c
> > +++ b/source3/winbindd/winbindd_samr.c
> > @@ -199,9 +199,7 @@ static NTSTATUS sam_query_user_list(struct
> > winbindd_domain *domain,> 
> >  		goto done;
> >  	
> >  	}
> > 
> > -	if (prids) {
> > -		*prids = talloc_move(mem_ctx, &rids);
> > -	}
> > +	*prids = talloc_move(mem_ctx, &rids);
> > 
> >  done:
> >  	if (b && is_valid_policy_hnd(&dom_pol)) {
> 
> Shouldn't this be:
> 
> diff --git a/source3/winbindd/winbindd_samr.c
> b/source3/winbindd/winbindd_samr.c index dd674965f17..d2ce1d2d5e2 100644
> --- a/source3/winbindd/winbindd_samr.c
> +++ b/source3/winbindd/winbindd_samr.c
> @@ -176,8 +176,6 @@ static NTSTATUS sam_query_user_list(struct
> winbindd_domain *domain,
> 
>         DEBUG(3,("samr_query_user_list\n"));
> 
> -       *prids = NULL;
> -
>         tmp_ctx = talloc_stackframe();
>         if (tmp_ctx == NULL) {
>                 return NT_STATUS_NO_MEMORY;
> 
> instead ?

Yes, and we need backports to 4.6 which has already been branched. So could 
someone please create a bug for them?



Thanks,



	Andreas

-- 
Andreas Schneider                   GPG-ID: CC014E3D
Samba Team                             asn at samba.org
www.samba.org



More information about the samba-technical mailing list