mirror of
https://github.com/curl/curl.git
synced 2026-08-25 08:53:36 +03:00
pop3: check for CAPA responses case insensitively
Reported by ZeroPath Closes #19278
This commit is contained in:
parent
55d4767876
commit
c1f1b66d78
1 changed files with 7 additions and 11 deletions
18
lib/pop3.c
18
lib/pop3.c
|
|
@ -878,15 +878,15 @@ static CURLcode pop3_state_capa_resp(struct Curl_easy *data, int pop3code,
|
|||
/* Do we have an untagged continuation response? */
|
||||
if(pop3code == '*') {
|
||||
/* Does the server support the STLS capability? */
|
||||
if(len >= 4 && !memcmp(line, "STLS", 4))
|
||||
if(len >= 4 && curl_strnequal(line, "STLS", 4))
|
||||
pop3c->tls_supported = TRUE;
|
||||
|
||||
/* Does the server support clear text authentication? */
|
||||
else if(len >= 4 && !memcmp(line, "USER", 4))
|
||||
else if(len >= 4 && curl_strnequal(line, "USER", 4))
|
||||
pop3c->authtypes |= POP3_TYPE_CLEARTEXT;
|
||||
|
||||
/* Does the server support SASL based authentication? */
|
||||
else if(len >= 5 && !memcmp(line, "SASL ", 5)) {
|
||||
else if(len >= 5 && curl_strnequal(line, "SASL ", 5)) {
|
||||
pop3c->authtypes |= POP3_TYPE_SASL;
|
||||
|
||||
/* Advance past the SASL keyword */
|
||||
|
|
@ -896,13 +896,10 @@ static CURLcode pop3_state_capa_resp(struct Curl_easy *data, int pop3code,
|
|||
/* Loop through the data line */
|
||||
for(;;) {
|
||||
size_t llen;
|
||||
size_t wordlen;
|
||||
size_t wordlen = 0;
|
||||
unsigned short mechbit;
|
||||
|
||||
while(len &&
|
||||
(*line == ' ' || *line == '\t' ||
|
||||
*line == '\r' || *line == '\n')) {
|
||||
|
||||
while(len && (ISBLANK(*line) || ISNEWLINE(*line))) {
|
||||
line++;
|
||||
len--;
|
||||
}
|
||||
|
|
@ -911,9 +908,8 @@ static CURLcode pop3_state_capa_resp(struct Curl_easy *data, int pop3code,
|
|||
break;
|
||||
|
||||
/* Extract the word */
|
||||
for(wordlen = 0; wordlen < len && line[wordlen] != ' ' &&
|
||||
line[wordlen] != '\t' && line[wordlen] != '\r' &&
|
||||
line[wordlen] != '\n';)
|
||||
while(wordlen < len && !ISBLANK(line[wordlen]) &&
|
||||
!ISNEWLINE(line[wordlen]))
|
||||
wordlen++;
|
||||
|
||||
/* Test the word for a matching authentication mechanism */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue