]> granicus.if.org Git - neomutt/commitdiff
Don't allow imap URLs with empty hosts. Also don't attempt to complete
authorBrendan Cully <brendan@kublai.com>
Thu, 22 Sep 2005 03:09:49 +0000 (03:09 +0000)
committerBrendan Cully <brendan@kublai.com>
Thu, 22 Sep 2005 03:09:49 +0000 (03:09 +0000)
on open connections when there aren't any (diagnosed by Nico Golde).
Closes: #2079.
imap/imap.c
imap/util.c

index 9be978b841fbf54d90c7a92ea8dad893b3f5535d..743137c44eb1e30ab788e2043eef3b73dbde44d5 100644 (file)
@@ -1612,7 +1612,7 @@ imap_complete_hosts (char *dest, size_t len)
     }
   }
   
-  for (conn = mutt_socket_head (); conn->next; conn = conn->next)
+  for (conn = mutt_socket_head (); conn && conn->next; conn = conn->next)
   {
     ciss_url_t url;
     char urlstr[LONG_STRING];
index 1ae9e2382638d134c21fd8a52fb84b5e93691b5f..8df1fa41ce9c1fbdaea7d8c846e063e8d77d577d 100644 (file)
@@ -107,7 +107,7 @@ int imap_parse_path (const char* path, IMAP_MBOX* mx)
   url_parse_ciss (&url, c);
   if (url.scheme == U_IMAP || url.scheme == U_IMAPS)
   {
-    if (mutt_account_fromurl (&mx->account, &url) < 0)
+    if (mutt_account_fromurl (&mx->account, &url) < 0 || !*mx->account.host)
     {
       FREE (&c);
       return -1;
@@ -165,7 +165,7 @@ int imap_parse_path (const char* path, IMAP_MBOX* mx)
       }
     }
   }
-  
+
   if ((mx->account.flags & M_ACCT_SSL) && !(mx->account.flags & M_ACCT_PORT))
     mx->account.port = ImapsPort;