From: ehlertjd@gmail.com Date: Fri, 1 Apr 2016 14:13:39 +0000 (-0500) Subject: IMAP: check pointer before dereferencing it X-Git-Tag: curl-7_49_0~241 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8f654f29de0329214fac09c043c03100bfd3f96f;p=thirdparty%2Fcurl.git IMAP: check pointer before dereferencing it may be null in the CURLOPT_CONNECT_ONLY case Fixes #747 --- diff --git a/lib/imap.c b/lib/imap.c index 934532de35..c509f115c6 100644 --- a/lib/imap.c +++ b/lib/imap.c @@ -364,7 +364,7 @@ static bool imap_endofresp(struct connectdata *conn, char *line, size_t len, a space and optionally some text as per RFC-3501 for the AUTHENTICATE and APPEND commands and as outlined in Section 4. Examples of RFC-4959 but some e-mail servers ignore this and only send a single + instead. */ - if(!imap->custom && ((len == 3 && !memcmp("+", line, 1)) || + if(imap && !imap->custom && ((len == 3 && !memcmp("+", line, 1)) || (len >= 2 && !memcmp("+ ", line, 2)))) { switch(imapc->state) { /* States which are interested in continuation responses */