]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
IMAP: check pointer before dereferencing it
authorehlertjd@gmail.com <ehlertjd@gmail.com>
Fri, 1 Apr 2016 14:13:39 +0000 (09:13 -0500)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 1 Apr 2016 19:18:46 +0000 (21:18 +0200)
may be null in the CURLOPT_CONNECT_ONLY case

Fixes #747

lib/imap.c

index 934532de350ef00bd4c1296caa5bcf46c14413cc..c509f115c64560f33a443fc37529897c044190e6 100644 (file)
@@ -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 */