diff --git a/lib/imap.c b/lib/imap.c index 0c0154824d..5d94548a33 100644 --- a/lib/imap.c +++ b/lib/imap.c @@ -1283,6 +1283,10 @@ static CURLcode imap_statemach_act(struct connectdata *conn) if(result) return result; + /* Was there an error parsing the response line? */ + if(imapcode == -1) + return CURLE_FTP_WEIRD_SERVER_REPLY; + if(imapcode) { /* We have now received a full IMAP server response */ switch(imapc->state) {