Skip to content
Permalink
Browse files

ldap: Stop using wide char version of ldapp_err2string

Despite ldapp_err2string being documented by MS as returning a
PCHAR (char *), when UNICODE it is mapped to ldap_err2stringW and
returns PWCHAR (wchar_t *).

We have lots of code that expects ldap_err2string to return char *,
most of it failf used like this:

failf(data, "LDAP local: Some error: %s", ldap_err2string(rc));

Closes #4272
  • Loading branch information...
jay committed Aug 27, 2019
1 parent 9cd755e commit 08f96982a910eb83e2be03a7db1305c8668f9668
Showing with 6 additions and 0 deletions.
  1. +6 −0 lib/ldap.c
@@ -119,6 +119,12 @@ static void _ldap_free_urldesc(LDAPURLDesc *ludp);
#define LDAP_TRACE(x) Curl_nop_stmt
#endif

#if defined(USE_WIN32_LDAP) && defined(ldap_err2string)
/* Use ansi error strings in UNICODE builds */
#undef ldap_err2string
#define ldap_err2string ldap_err2stringA
#endif


static CURLcode Curl_ldap(struct connectdata *conn, bool *done);

0 comments on commit 08f9698

Please sign in to comment.
You can’t perform that action at this time.