Seg fault with ldap.get_option(ldap.OPT_SERVER_CONTROLS)

Deepak Giridharagopal deepak at
Tue Mar 1 21:09:20 CET 2005

On Tue, 2005-03-01 at 20:41 +0100, Michael Ströder wrote:
> I have problems using ldap.get_option(ldap.OPT_SERVER_CONTROLS):
> $ python2.4 -c "import ldap;ldap.get_option(ldap.OPT_SERVER_CONTROLS)"
> Segmentation fault
> Any clue? I'm not a C programmer so I can't tell where the bug lies.

I found it...there was one spot where I forgot to check to make sure a
pointer wasn't NULL before I messed with it. Embarrassing! :) It's a
2-line fix, and I've attached the patch.

Maybe we should start throwing together some simple tests and throw them
into Tests/Lib/ldap/ or the like?

Also, as an aside, I noticed that in the CVS head the file
doesn't include the new ldapcontrol.c file in its list of files to be
compiled. This (a 1-line change) is also in the patch.


Deepak Giridharagopal
Applied Research Laboratories
University of Texas at Austin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ldapcontrols_getoption_fix.patch
Type: text/x-patch
Size: 871 bytes
Desc: not available
URL: <>

More information about the python-ldap mailing list