Seg fault with ldap.get_option(ldap.OPT_SERVER_CONTROLS)

Deepak Giridharagopal deepak at arlut.utexas.edu
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/test_ldapcontrols.py or the like?

Also, as an aside, I noticed that in the CVS head the setup.py 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.

Cheers!
deepak

--
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: <http://mail.python.org/pipermail/python-ldap/attachments/20050301/7089ab0f/attachment.bin>


More information about the python-ldap mailing list