From c4fe0c7b9ffbb8884ca8383230006b03c00d5028 Mon Sep 17 00:00:00 2001 From: Jay Satiro Date: Fri, 26 Jun 2026 14:12:43 -0400 Subject: [PATCH] ldap: support empty username and password Prior to this change an empty username or password was passed to the LDAP bind function as NULL instead of an empty string. Regression since 8f71d0fd. Reported-by: Yoshiro Yoneya Fixes https://github.com/curl/curl/issues/22162 Closes https://github.com/curl/curl/pull/22196 --- lib/ldap.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/ldap.c b/lib/ldap.c index a7c1fe8c83..c8830b3edc 100644 --- a/lib/ldap.c +++ b/lib/ldap.c @@ -282,10 +282,8 @@ static CURLcode ldap_do(struct Curl_easy *data, bool *done) #else char *host = NULL; #endif - const char *user = Curl_creds_has_user(data->state.creds) ? - data->state.creds->user : NULL; - const char *passwd = Curl_creds_has_passwd(data->state.creds) ? - data->state.creds->passwd : NULL; + const char *user = data->state.creds ? data->state.creds->user : NULL; + const char *passwd = data->state.creds ? data->state.creds->passwd : NULL; struct ip_quadruple ipquad; bool is_ipv6; BerElement *ber = NULL;