Skip to content

Commit 57971db

Browse files
flatcapjeriko-one
andcommitted
Selectively cache headers
Co-authored-by: JerikoOne <jeriko.one@gmx.us>
1 parent 2761cab commit 57971db

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Diff for: imap/util.c

+6
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,12 @@ header_cache_t *imap_hcache_open(struct ImapData *idata, const char *path)
245245
FREE(&mx.mbox);
246246
}
247247

248+
if (strstr(mbox, "/../") || (strcmp(mbox, "..") == 0) || (strncmp(mbox, "../", 3) == 0))
249+
return NULL;
250+
size_t len = strlen(mbox);
251+
if ((len > 3) && (strcmp(mbox + len - 3, "/..") == 0))
252+
return NULL;
253+
248254
mutt_account_tourl(&idata->conn->account, &url);
249255
url.path = mbox;
250256
url_tostring(&url, cachepath, sizeof(cachepath), U_PATH);

0 commit comments

Comments
 (0)