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

Re: (ITS#4436) Freeing invalid pointer - GLIBC 2.4



> Full_Name: Jiri Netolicky
> Version: 2.2.28-r4
> OS: Gentoo 2006.0
> URL:
> Submission from: (NULL) (82.117.130.2)
>
>
> To day I have upgraded GLIBC into 2.4 version. All ldap client utils
stops
> work.
> Glibc wrote message like:
> *** glibc detected *** ldapmodify: munmap_chunk(): invalid pointer:
0xbfc11582
> ***
>
> I am using param SASL_AUTHCID in my .ldaprc. The problem is in init.c
line
> 556.
> There is fill
>
> gopts->ldo_def_sasl_authcid = user
>
> where the user is DIRECTLY from getenv("USER").
>
> After that when is readed .ldaprc in function openldap_ldap_init_w_conf,
the
> sasl_authcid is freed when it's not null. But freeing strings from
getenv
> seems
> to be checked in new version of GLIBC.
> I think the best solution will be make a copy of user name like this:
>
> gopts->ldo_def_sasl_authcid = LDAP_STRDUP(user);
>
> After this small patch works everything fine.
>
> --- openldap-2.2.28/libraries/libldap/init.c    2005-01-20
> 18:01:01.000000000
> +0100
> +++ openldap-2.2.28-patch/libraries/libldap/init.c      2006-03-14
17:17:13.000000000 +0100
> @@ -553,7 +553,7 @@
>                 if( user == NULL ) user = getenv("LOGNAME");
>
>                 if( user != NULL ) {
> -                       gopts->ldo_def_sasl_authcid = user;
> +                       gopts->ldo_def_sasl_authcid = LDAP_STRDUP(user);
>                 }
>      }
>  #endif

The issue is still present in HEAD/re23; it should now be fixed in HEAD.
Thanks for reporting.

p.






Ing. Pierangelo Masarati
Responsabile Open Solution
OpenLDAP Core Team

SysNet s.n.c.
Via Dossi, 8 - 27100 Pavia - ITALIA
http://www.sys-net.it
------------------------------------------
Office:   +39.02.23998309          
Mobile:   +39.333.4963172
Email:    pierangelo.masarati@sys-net.it
------------------------------------------