]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
imap: treat capabilities case insensitively
authorDaniel Stenberg <daniel@haxx.se>
Fri, 17 Oct 2025 07:58:20 +0000 (09:58 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 17 Oct 2025 08:40:37 +0000 (10:40 +0200)
Reported-by: Joshua Rogers
Fixes #19089
Closes #19090

lib/imap.c

index 47757d3f29780524e08c1f43ad725f0c8b0f5eb3..0feaedf5acc857611c18e56d9a4a4544980fed94 100644 (file)
@@ -1056,19 +1056,19 @@ static CURLcode imap_state_capability_resp(struct Curl_easy *data,
         wordlen++;
 
       /* Does the server support the STARTTLS capability? */
-      if(wordlen == 8 && !memcmp(line, "STARTTLS", 8))
+      if(wordlen == 8 && curl_strnequal(line, "STARTTLS", 8))
         imapc->tls_supported = TRUE;
 
       /* Has the server explicitly disabled clear text authentication? */
-      else if(wordlen == 13 && !memcmp(line, "LOGINDISABLED", 13))
+      else if(wordlen == 13 && curl_strnequal(line, "LOGINDISABLED", 13))
         imapc->login_disabled = TRUE;
 
       /* Does the server support the SASL-IR capability? */
-      else if(wordlen == 7 && !memcmp(line, "SASL-IR", 7))
+      else if(wordlen == 7 && curl_strnequal(line, "SASL-IR", 7))
         imapc->ir_supported = TRUE;
 
       /* Do we have a SASL based authentication mechanism? */
-      else if(wordlen > 5 && !memcmp(line, "AUTH=", 5)) {
+      else if(wordlen > 5 && curl_strnequal(line, "AUTH=", 5)) {
         size_t llen;
         unsigned short mechbit;