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

Re: (ITS#4860) Sets' enhancement



raphael.ouazana@linagora.com wrote:

I see at least 2 issues in this patch:

1) the use of dnParent() in place on malloc'd data would lead to memory
corruption, because at some point the value of the set will be freed,
but the bv_val of that value would no longer point to the beginning of a
malloc()'ed block.  You should rather use AC_MEMCPY() to move the
parent's DN at the beginning of the malloc()'ed memory block.

2) when trimming a set of DNs to some ancestor, DNs with common
ancestors could result in duplicate set values.  I'm not sure this
currently has any adverse effect on set evaluation, but I'd consider it
bad anyway.  You should eliminate duplicates, in case any arises.

p.



Ing. Pierangelo Masarati
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
------------------------------------------