openldap: explain a const removing typecast

Closes #19056
This commit is contained in:
Daniel Stenberg 2025-10-14 10:49:53 +02:00
parent 1ea99afdc7
commit 61dcb56743
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2

View file

@ -468,6 +468,10 @@ static CURLcode oldap_perform_mechs(struct Curl_easy *data)
if(!li)
return CURLE_FAILED_INIT;
/* Casting away the const for the 3rd parameter that the LDAP API expects as
a non-const char ** is potentially unsafe but we believe the lack of
const in the API was an oversight and that no LDAP implementation
actually modifies the input. */
rc = ldap_search_ext(li->ld, "", LDAP_SCOPE_BASE, "(objectclass=*)",
(char **)CURL_UNCONST(supportedSASLMechanisms), 0,
NULL, NULL, NULL, 0, &li->msgid);