[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
RE: sasl_errdetail result needs strdup (ITS#2590)
This is a known bug and is already fixed in 2.1.21. Please update your
source. This ITS will be closed.
-- Howard Chu
Chief Architect, Symas Corp. Director, Highland Sun
http://www.symas.com http://highlandsun.com/hyc
Symas: Premier OpenSource Development and Support
> -----Original Message-----
> From: owner-openldap-bugs@OpenLDAP.org
> [mailto:owner-openldap-bugs@OpenLDAP.org]On Behalf Of nelson@thursby.com
> Full_Name: Paul Nelson
> Version: 2.1.17
> OS: Mac OS X
> URL: ftp://ftp.openldap.org/incoming/
> Submission from: (NULL) (208.7.44.100)
>
>
> In the source file cyrus.c:
>
> Line 625 is an example where sasl_errdetail is called and the
> result is saved in
> ld->ld_error.
>
> ld->ld_error is later freed in other parts of ldap, but the
> sasl library also
> frees the value it returned from sasl_errdetail.
>
> I believe the correct code should strdup the value returned
> from sasl_errdetail
> as follows:
> 625c625
> < ld->ld_error = (char *)sasl_errdetail( ctx );
> ---
> > ld->ld_error = LDAP_STRDUP((char
> *)sasl_errdetail( ctx ));
> 722c722
> < ld->ld_error = (char *)sasl_errdetail( ctx );
> ---
> > ld->ld_error = LDAP_STRDUP((char
> *)sasl_errdetail( ctx
> ));
> 733c733
> < ld->ld_error = (char *)sasl_errdetail( ctx );
> ---
> > ld->ld_error = LDAP_STRDUP((char
> *)sasl_errdetail( ctx ));
>
>
> The extra free can result in memory allocation trouble later
> on, ranging from no
> big deal to real trouble on multi-threaded apps.
>