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

Re: Bug in ldap_controls_free

At 03:08 PM 2/16/00 -0700, Dave Steck wrote:
>Kurt, I now understand your comment about moving the assert
>instead of removing it.
>	ldap_controls_free( LDAPControl **controls )
>	{
>	        assert( controls != NULL );
>	#endif
>	...
>For what it's worth, doing it this way means valid LDAP programs can
>still crash here.

Yes. LDAP_MEMORY_DEBUG should not be enabled in general.  It's
meant only to be used in debugging the SDK internals and our
server implementation.  This is generally done using programs
designed to be compatible with the macro.

>Some programs are written relying on the NOP behavior for NULL
>input as described in the draft.

Yes.  But this macro, and a number of other macros, should only be
enabled by developer's of OpenLDAP when running specific tests.

>You would not be able to debug these programs with LDAP_MEMORY_DEBUG on.

I do often debug internals with applications relying on NULL okay
behavior,  I just tell my debugger to jump over assert() or *_free()
call (after verifying proper implementation).

I've added a comment to libraries/liblber/memory.c to clarify
the intended limited use of this macro.