#2027 winldap.h ldap_start_tls function error

WSL
pending
Earnie Boyd
None
Bug
fixed
Feature_in_WSL_4.1
False
2014-04-12
2013-09-04
Noirello
No

The following code is causing segfault:

#include <windows.h>
#include <winldap.h>

int main(void) {
    LDAP *ld;
    int rc;
    PCHAR hostName = "ldapserver";

    ld = ldap_init(hostName, LDAP_PORT); 
    ldap_start_tls_sA(ld, NULL, NULL);
    rc = ldap_connect(ld, NULL);
    printf("RC %x\n", rc);
    return 0;
}

According to MSDN ldap_start_tls_sA should have 2 more parameters.
Compiling with VC++ with two more NULL parameters the program runs without segfault.

Discussion

  • Earnie Boyd
    Earnie Boyd
    2013-09-04

    • status: unread --> assigned
    • assigned_to: Earnie Boyd
    • Category: Unknown --> Feature_in_WSL_4.1
     
  • Earnie Boyd
    Earnie Boyd
    2013-09-04

    Thanks for the report.

     
  • Earnie Boyd
    Earnie Boyd
    2013-09-18

    • status: assigned --> pending
    • Resolution: none --> fixed
     
  • Earnie Boyd
    Earnie Boyd
    2013-09-18

    Resolved in the 4.1-dev branch pending release.

     
  • Noirello
    Noirello
    2014-04-12

    Sorry for the late response, but I think the winldap header in 4.1-dev branch is not well fixed.
    I attached a patch which contains the correct function declarations.
    (It also contains a missing define.)

     
    Attachments