Skip to content

Commit

Permalink
Selectively cache headers
Browse files Browse the repository at this point in the history
Co-authored-by: JerikoOne <jeriko.one@gmx.us>
  • Loading branch information
flatcap and jeriko-one committed Jul 9, 2018
1 parent 2761cab commit 57971db
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions imap/util.c
Expand Up @@ -245,6 +245,12 @@ header_cache_t *imap_hcache_open(struct ImapData *idata, const char *path)
FREE(&mx.mbox);
}

if (strstr(mbox, "/../") || (strcmp(mbox, "..") == 0) || (strncmp(mbox, "../", 3) == 0))
return NULL;
size_t len = strlen(mbox);
if ((len > 3) && (strcmp(mbox + len - 3, "/..") == 0))
return NULL;

mutt_account_tourl(&idata->conn->account, &url);
url.path = mbox;
url_tostring(&url, cachepath, sizeof(cachepath), U_PATH);
Expand Down

0 comments on commit 57971db

Please sign in to comment.