Zhang Huangbin wrote:
> Michael Ströder wrote:
>> Could somebody with more knowledge of C programming please review
>> function encode_rfc2696() in Modules/ldapcontrol.c?
>>
>> The following var declaration could be problematic on 64-bit systems:
>>
>>     unsigned long size;

Thanks to Zhang Huangbin for giving me access to his machine for testing.

So I could track it down. It seems to work with the patch below which I
committed to CVS HEAD.

Ciao, Michael.

Index: Modules/ldapcontrol.c
===================================================================
RCS file: /cvsroot/python-ldap/python-ldap/Modules/ldapcontrol.c,v
retrieving revision 1.9
diff -u -r1.9 ldapcontrol.c
--- Modules/ldapcontrol.c       20 Mar 2008 12:24:56 -0000      1.9
+++ Modules/ldapcontrol.c       16 Mar 2009 14:48:49 -0000
@@ -241,13 +241,15 @@
     PyObject *res = 0;
     BerElement *ber = 0;
     struct berval cookie, *ctrl_val;
+    Py_ssize_t cookie_len;
     unsigned long size;
     ber_tag_t tag;

     if (!PyArg_ParseTuple(args, "is#:encode_page_control", &size,
-                          &cookie.bv_val, &cookie.bv_len)) {
+                          &cookie.bv_val, &cookie_len)) {
         goto endlbl;
     }
+    cookie.bv_len = (ber_len_t) cookie_len;

     if (!(ber = ber_alloc_t(LBER_USE_DER))) {
         LDAPerr(LDAP_NO_MEMORY);


------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Python-LDAP-dev mailing list
Python-LDAP-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/python-ldap-dev

Reply via email to