[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: (ITS#4394) Fix Segfault in auditlog.c



Thanks for the bug report. I believe the actual bug is that in the 
modify case it needs to check that the mod op is actually an Add (or 
Replace) and not a Delete. Syncrepl would never replicate an empty 
ModifiersName in the add case.

richter@ecos.de wrote:
> Full_Name: Gerald Richter
> Version: 2.3.19
> OS: Linux 2.4
> URL: ftp://ftp.openldap.org/incoming/
> Submission from: (NULL) (194.95.226.11)
>
>
> The auditlog overlay causes a segfault when no dn for the user performing the
> operation is available, like it happens on the syncrepl consumer during an
> update from the master. The following patch fixes this problem:
>
> --- ./servers/slapd/overlays/auditlog.c~	Thu Feb  9 21:16:40 2006
> +++ ./servers/slapd/overlays/auditlog.c	Thu Feb  9 21:55:52 2006
> @@ -72,7 +72,8 @@
>  			what = "add";
>  			for(a = op->ora_e->e_attrs; a; a = a->a_next)
>  				if( a->a_desc == slap_schema.si_ad_modifiersName ) {
> -					who = a->a_vals[0].bv_val;
> +					if (a->a_vals)
> +						who = a->a_vals[0].bv_val;
>  					break;
>  				}
>  			break;
> @@ -80,7 +81,8 @@
>  			what = "modify";
>  			for(m = op->orm_modlist; m; m = m->sml_next)
>  				if( m->sml_desc == slap_schema.si_ad_modifiersName ) {
> -					who = m->sml_values[0].bv_val;
> +					if (m->sml_values)
> +						who = m->sml_values[0].bv_val;
>  					break;
>  				}
>  			break;
>
>
>   


-- 
  -- Howard Chu
  Chief Architect, Symas Corp.  http://www.symas.com
  Director, Highland Sun        http://highlandsun.com/hyc
  OpenLDAP Core Team            http://www.openldap.org/project/