summaryrefslogtreecommitdiff
path: root/lib/imap.c
diff options
context:
space:
mode:
authorehlertjd@gmail.com <ehlertjd@gmail.com>2016-04-01 09:13:39 -0500
committerDaniel Stenberg <daniel@haxx.se>2016-04-01 21:18:46 +0200
commit8f654f29de0329214fac09c043c03100bfd3f96f (patch)
tree813b6c792e38c7b16d5f7be111197261ecc1995a /lib/imap.c
parent8010376fadb963aa38360e782ea9c28f4ea5bf76 (diff)
downloadcurl-8f654f29de0329214fac09c043c03100bfd3f96f.tar.gz
IMAP: check pointer before dereferencing it
may be null in the CURLOPT_CONNECT_ONLY case Fixes #747
Diffstat (limited to 'lib/imap.c')
-rw-r--r--lib/imap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/imap.c b/lib/imap.c
index 934532de3..c509f115c 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 */