[PATCH] fix SEGV in ldb_map_outbound.c

Michael Adam obnox at samba.org
Wed Sep 18 19:01:40 CEST 2013


pushed to autobuild.
(with Volker's and Simo's review)

Cheers - Michael

On 2013-09-17 at 22:16 -0700, Howard Chu wrote:
> 
> -- 
>   -- Howard Chu
>   CTO, Symas Corp.           http://www.symas.com
>   Director, Highland Sun     http://highlandsun.com/hyc/
>   Chief Architect, OpenLDAP  http://www.openldap.org/project/

> >From 65c6ee5031b1b3e1dfafdf4b6137fefb156541d8 Mon Sep 17 00:00:00 2001
> From: Howard Chu <hyc at symas.com>
> Date: Tue, 17 Sep 2013 22:14:20 -0700
> Subject: [PATCH] Fix SEGV from improperly formed SUBSTRING/PRESENCE filter
> 
> 
> Signed-off-by: Howard Chu <hyc at symas.com>
> ---
>  lib/ldb/ldb_map/ldb_map_outbound.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/ldb/ldb_map/ldb_map_outbound.c b/lib/ldb/ldb_map/ldb_map_outbound.c
> index c6c86e3..5be5e76 100644
> --- a/lib/ldb/ldb_map/ldb_map_outbound.c
> +++ b/lib/ldb/ldb_map/ldb_map_outbound.c
> @@ -848,7 +848,7 @@ int map_subtree_collect_remote_simple(struct ldb_module *module, void *mem_ctx,
>  		int i;
>  		/* Map value */
>  		(*new)->u.substring.chunks = NULL;
> -		for (i=0; tree->u.substring.chunks[i]; i++) {
> +		for (i=0; tree->u.substring.chunks && tree->u.substring.chunks[i]; i++) {
>  			(*new)->u.substring.chunks = talloc_realloc(*new, (*new)->u.substring.chunks, struct ldb_val *, i+2);
>  			if (!(*new)->u.substring.chunks) {
>  				talloc_free(*new);
> -- 
> 1.8.1.2
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 215 bytes
Desc: Digital signature
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20130918/5a2dc937/attachment.pgp>


More information about the samba-technical mailing list