[389-devel] Please review: [389 Project] #603: A logic error in str2simple
Noriko Hosoi
nhosoi at redhat.com
Thu Feb 28 22:00:35 UTC 2013
https://fedorahosted.org/389/ticket/603
https://fedorahosted.org/389/attachment/ticket/603/0001-Ticket-603-A-logic-error-in-str2simple.patch
Fix description: str2simple sets the strdup'ed type this way:
if ( f->f_choice == LDAP_FILTER_PRESENT ) {
f->f_type = slapi_ch_strdup( str );
} else if ( unescape_filter ) {
f->f_avtype = slapi_ch_strdup( str );
} if ( !unescape_filter ) {
f->f_avtype = slapi_ch_strdup( str );
}
If f_choice is LDAP_FILTER_PRESENT and !unescape_filter is
true, the first strdup'ed string is leaked since f_type
and f_avtype share the same memory. But currently, str2simple
is not called with (unescape_filter == 0). Thus there is no
chance to satisfy the condition. This patch fixes the flaw.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.fedoraproject.org/pipermail/389-devel/attachments/20130228/1b2a530c/attachment.html>
More information about the 389-devel
mailing list