]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
openldap: set the callback argument in oldap_do
authorDaniel Stenberg <daniel@haxx.se>
Thu, 19 Oct 2023 22:04:28 +0000 (00:04 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Sat, 21 Oct 2023 12:42:25 +0000 (14:42 +0200)
... to make sure it has the current 'data' pointer and not a stale old
one.

Reported-by: Dan Fandrich
Closes #12166

lib/openldap.c

index 3aff3060a16ab5d866581a9fadf8ef4278bacada..64de153b22255d81508eb3999dd3abfaa7c342df 100644 (file)
@@ -886,6 +886,11 @@ static CURLcode oldap_do(struct Curl_easy *data, bool *done)
 
   result = oldap_url_parse(data, &lud);
   if(!result) {
+    Sockbuf *sb;
+    /* re-install the libcurl SSL handlers into the sockbuf. */
+    ldap_get_option(li->ld, LDAP_OPT_SOCKBUF, &sb);
+    ber_sockbuf_add_io(sb, &ldapsb_tls, LBER_SBIOD_LEVEL_TRANSPORT, data);
+
     rc = ldap_search_ext(li->ld, lud->lud_dn, lud->lud_scope,
                          lud->lud_filter, lud->lud_attrs, 0,
                          NULL, NULL, NULL, 0, &msgid);