]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
openldap: improve check for receiving blank data
authorDaniel Stenberg <daniel@haxx.se>
Sat, 20 Sep 2025 10:21:26 +0000 (12:21 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Sat, 20 Sep 2025 20:37:10 +0000 (22:37 +0200)
It can't access the first byte either unless it has length.

Followup to 232d5a2ed9c091c88e3b724a1e7d6

Closes #18632

lib/openldap.c

index 1f8737f5243ab0e44e043dedb80a79602ffbf953..717739b68d89663faeb0026e307551fd684b543a 100644 (file)
@@ -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 {