Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
4b9d7fc
lib-storage: Code cleanup - moved BODY/TEXT "" optimization to mail_s…
sirainen Dec 8, 2015
f14696c
lib-storage: Fix to a776ee107aa2 - merged-flag wasn't reset between a…
sirainen Dec 8, 2015
b6cf97d
lib-storage: mail_search_args_simplify() code cleanup - allow merging…
sirainen Dec 8, 2015
dfeae30
lib-storage: mail_search_args_simplify() handles now ALL better.
sirainen Dec 8, 2015
6d4758b
fts: Fixed searching for HEADER "" with lib-fts
sirainen Dec 8, 2015
983e2bc
fts: When indexing header names with lib-fts, add them using "data" l…
sirainen Dec 8, 2015
cfce7cc
doveadm director update: Tag can't be changed - don't allow -t parameter
sirainen Dec 9, 2015
02b51cd
lib-storage: Fixed mail_search_args_simplify() with empty args.
sirainen Dec 9, 2015
d9e60ea
virtual: Fixed assert-crash when opening virtual mailbox triggered ba…
sirainen Dec 9, 2015
827b071
acl: Empty lines and comments in dovecot-acl files weren't handled co…
sirainen Dec 9, 2015
d0044d1
Makefile, update-version.sh: Switched from hg to git.
sirainen Dec 9, 2015
97bede2
Removed .hgsigs and .hgtags
sirainen Dec 9, 2015
1ce79f0
Switched .hgignore to .gitignore
sirainen Dec 9, 2015
f43b59a
Makefile: Make ChangeLog depend on .git/index instead of .git/ORIG_HEAD
sirainen Dec 10, 2015
c0ac695
director: Don't trigger a ring resync if only last_updown_change has …
sirainen Dec 10, 2015
c4eda2a
director: Don't mark the host desynced if director is alone in ring.
sirainen Dec 11, 2015
6b7309a
dovecot-config: Fixed setting LIBDOVECOT_LIBFTS[_DEPS]
sirainen Dec 11, 2015
5345f22
Released v2.2.21.
sirainen Dec 11, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
lib-storage: Fixed mail_search_args_simplify() with empty args.
This fixes assert-crash in doveadm mailbox list.
  • Loading branch information
sirainen committed Dec 9, 2015
commit 02b51cddfb244fbe3972b12fb3e05183e38879d8
5 changes: 4 additions & 1 deletion src/lib-storage/mail-search-args-simplify.c
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,9 @@ mail_search_args_simplify_drop_redundent_args(struct mail_search_arg **argsp,
unsigned int count, lowest_count = UINT_MAX;
bool ret = FALSE;

if (*argsp == NULL)
return FALSE;

child_subargs_type = and_arg ? SEARCH_OR : SEARCH_SUB;

/* find the arg which has the lowest number of child args */
Expand Down Expand Up @@ -399,7 +402,7 @@ mail_search_args_simplify_extract_common(struct mail_search_arg **argsp,
struct mail_search_arg *new_arg, *child_arg, *common_args = NULL;
enum mail_search_arg_type child_subargs_type;

if ((*argsp)->next == NULL) {
if (*argsp == NULL || (*argsp)->next == NULL) {
/* single arg, nothing to extract */
return FALSE;
}
Expand Down
14 changes: 14 additions & 0 deletions src/lib-storage/test-mail-search-args-simplify.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,24 @@ static void test_mail_search_args_simplify(void)
test_end();
}

static void test_mail_search_args_simplify_empty_lists(void)
{
struct mail_search_args *args;

test_begin("mail search args simplify empty args");

args = mail_search_build_init();
mail_search_args_simplify(args);
mail_search_args_unref(&args);

test_end();
}

int main(void)
{
static void (*test_functions[])(void) = {
test_mail_search_args_simplify,
test_mail_search_args_simplify_empty_lists,
NULL
};

Expand Down