From: Mehdi Abaakouk Date: Wed, 14 Nov 2018 09:07:37 +0000 (+0100) Subject: imap: remove imap_parse_path2() from imap_hcache_open() X-Git-Tag: 2019-10-25~529^2~10 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d5028c94aa6dcafb416bed60541cfad8af0fa277;p=neomutt imap: remove imap_parse_path2() from imap_hcache_open() --- diff --git a/imap/util.c b/imap/util.c index 55a363c2a..a529d42e8 100644 --- a/imap/util.c +++ b/imap/util.c @@ -381,18 +381,16 @@ header_cache_t *imap_hcache_open(struct ImapAccountData *adata, const char *path struct Url url; char cachepath[PATH_MAX]; char mbox[PATH_MAX]; - char buf[PATH_MAX]; if (path) imap_cachepath(adata, path, mbox, sizeof(mbox)); - else + else if (adata->mailbox) { - if (!adata->mailbox || - imap_parse_path2(adata->mailbox->path, NULL, buf, sizeof(buf)) < 0) - return NULL; - - imap_cachepath(adata, buf, mbox, sizeof(mbox)); + struct ImapMailboxData *mdata = imap_mdata_get(adata->mailbox); + imap_cachepath(adata, mdata->name, mbox, sizeof(mbox)); } + else + return NULL; if (strstr(mbox, "/../") || (strcmp(mbox, "..") == 0) || (strncmp(mbox, "../", 3) == 0)) return NULL;