Skip to content

Commit

Permalink
lib-storage: Harden check for imapdir list name
Browse files Browse the repository at this point in the history
Comparing char pointers to determine string equality is asking for trouble.
Use strcmp() instead.
  • Loading branch information
Josef 'Jeff' Sipek authored and cmouse committed Aug 7, 2018
1 parent 3c6030b commit 6bda3e3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib-storage/list/mailbox-list-maildir.c
Expand Up @@ -68,7 +68,7 @@ maildir_list_get_dirname_path(struct mailbox_list *list, const char *dir,
{
if (*name == '\0')
return dir;
else if (list->name == imapdir_mailbox_list.name)
else if (strcmp(list->name, imapdir_mailbox_list.name) == 0)
return t_strdup_printf("%s/%s", dir, name);

return t_strdup_printf("%s/%c%s", dir,
Expand Down

0 comments on commit 6bda3e3

Please sign in to comment.