Fix 'CVE-2018-1000121'

Merge: curl/curl@9889db0433
This commit is contained in:
Kawe Mazidjatari 2023-06-12 20:09:12 +02:00
parent 2739ff3a7d
commit 6069e9f00b

View File

@ -443,7 +443,7 @@ static ssize_t ldap_recv(struct connectdata *conn, int sockindex, char *buf,
for(ent = ldap_first_message(li->ld, msg); ent;
ent = ldap_next_message(li->ld, ent)) {
struct berval bv, *bvals, **bvp = &bvals;
struct berval bv, *bvals;
int binary = 0, msgtype;
CURLcode writeerr;
@ -505,9 +505,9 @@ static ssize_t ldap_recv(struct connectdata *conn, int sockindex, char *buf,
}
data->req.bytecount += bv.bv_len + 5;
for(rc = ldap_get_attribute_ber(li->ld, ent, ber, &bv, bvp);
rc == LDAP_SUCCESS;
rc = ldap_get_attribute_ber(li->ld, ent, ber, &bv, bvp)) {
for(rc = ldap_get_attribute_ber(li->ld, ent, ber, &bv, &bvals);
(rc == LDAP_SUCCESS) && bvals;
rc = ldap_get_attribute_ber(li->ld, ent, ber, &bv, &bvals)) {
int i;
if(bv.bv_val == NULL) break;