Skip to content
Permalink
Browse files Browse the repository at this point in the history
dlist: don't allow overwrite of arbitrary files
  • Loading branch information
brong authored and elliefm committed Aug 11, 2017
1 parent ec2e5f3 commit 5edadcf
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions imap/dlist.c
Expand Up @@ -141,16 +141,10 @@ EXPORTED const char *dlist_reserve_path(const char *part, int isarchive,
const struct message_guid *guid)
{
static char buf[MAX_MAILBOX_PATH];
const char *base;

/* part can be either a configured partition name, or a path */
if (strchr(part, '/')) {
base = part;
}
else {
base = isarchive ? config_archivepartitiondir(part)
: config_partitiondir(part);
}
/* part must be a configured partition name on this server */
const char *base = isarchive ? config_archivepartitiondir(part)
: config_partitiondir(part);

/* we expect to have a base at this point, so let's assert that */
assert(base != NULL);
Expand Down

0 comments on commit 5edadcf

Please sign in to comment.