[PATCH] Fix new Coverity IDs
Jeremy Allison
jra at samba.org
Tue Jan 10 23:40:41 UTC 2017
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)) {
> --
> 2.1.4
>
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 ?
More information about the samba-technical
mailing list