[PATCH - COVERITY] - ldb-samba/ldb_matching_rules: Fix CID 1349424 - Uninitialized pointer read

Jeremy Allison jra at samba.org
Tue Apr 26 19:00:40 UTC 2016


On Tue, Apr 26, 2016 at 06:01:08PM +0200, Robin Hack wrote:
> Hello.
> 
> Unitialized pointer were passed to talloc_* functions. Patch initialize
> pointer to NULL.
> 
> Review please :).

RB: Jeremy Allison <jra at samba.org>.

Obvious goodness. Second Team reviewer ?


> From a267880c6476be9d758c605f3b14b47bc481b3dc Mon Sep 17 00:00:00 2001
> From: Robin Hack <hack.robin at gmail.com>
> Date: Tue, 26 Apr 2016 17:51:46 +0200
> Subject: [PATCH] ldb-samba/ldb_matching_rules: Fix CID 1349424 - Uninitialized
>  pointer read
> 
> Fix unitialized 'visited' value (pointer to pointer) in
> ldb_eval_transitive_filter() which passes 'visited' value later to
> ldb_eval_transitive_filter_helper().
> 
> Signed-off-by: Robin Hack <hack.robin at gmail.com>
> ---
>  lib/ldb-samba/ldb_matching_rules.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/ldb-samba/ldb_matching_rules.c b/lib/ldb-samba/ldb_matching_rules.c
> index 1692a73..637858f 100644
> --- a/lib/ldb-samba/ldb_matching_rules.c
> +++ b/lib/ldb-samba/ldb_matching_rules.c
> @@ -206,7 +206,7 @@ static int ldb_eval_transitive_filter(TALLOC_CTX *mem_ctx,
>  	struct dsdb_dn *dn_to_match;
>  	const char *dn_oid;
>  	unsigned int count;
> -	struct dsdb_dn **visited;
> +	struct dsdb_dn **visited = NULL;
>  
>  	schema = dsdb_get_schema(ldb, mem_ctx);
>  	if (schema == NULL) {
> -- 
> 1.9.3
> 




More information about the samba-technical mailing list