From: Steve Holme Date: Fri, 18 Apr 2014 14:01:57 +0000 (+0100) Subject: imap: Fixed untagged response detection when no data after command X-Git-Tag: curl-7_37_0~155 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2c6b41e98a566486877938cfeaba4c946388485a;p=thirdparty%2Fcurl.git imap: Fixed untagged response detection when no data after command Should a command return untagged responses that contained no data then the imap_matchresp() function would not detect them as valid responses, as it wasn't taking the CRLF characters into account at the end of each line. --- diff --git a/lib/imap.c b/lib/imap.c index a3dd499268..3881d61897 100644 --- a/lib/imap.c +++ b/lib/imap.c @@ -258,7 +258,7 @@ static bool imap_matchresp(const char *line, size_t len, const char *cmd) /* Does the command name match and is it followed by a space character or at the end of line? */ if(line + cmd_len <= end && Curl_raw_nequal(line, cmd, cmd_len) && - (line[cmd_len] == ' ' || line + cmd_len == end)) + (line[cmd_len] == ' ' || line + cmd_len + 2 == end)) return TRUE; return FALSE;