From: Daniel Stenberg Date: Sat, 20 Sep 2025 10:21:26 +0000 (+0200) Subject: openldap: improve check for receiving blank data X-Git-Tag: rc-8_17_0-3~518 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=979366a62568ca2ea0f8bed19fd901499c8dc178;p=thirdparty%2Fcurl.git openldap: improve check for receiving blank data It can't access the first byte either unless it has length. Followup to 232d5a2ed9c091c88e3b724a1e7d6 Closes #18632 --- diff --git a/lib/openldap.c b/lib/openldap.c index 1f8737f524..717739b68d 100644 --- a/lib/openldap.c +++ b/lib/openldap.c @@ -1171,8 +1171,8 @@ static CURLcode oldap_recv(struct Curl_easy *data, int sockindex, char *buf, if(!binary) { /* check for leading or trailing whitespace */ - if(ISBLANK(bvals[i].bv_val[0]) || - (bvals[i].bv_len && + if(bvals[i].bv_len && + (ISBLANK(bvals[i].bv_val[0]) || ISBLANK(bvals[i].bv_val[bvals[i].bv_len - 1]))) binval = TRUE; else {