From b2c7d290a3910b0da4b0b429dc2efc1ccfc20589 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Tue, 6 Jul 2010 13:44:48 +0100 Subject: [PATCH] lib-storage: Don't crash if invalid parameter is given to SEARCH OLDER. --HG-- branch : HEAD --- src/lib-storage/mail-search-register-imap.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lib-storage/mail-search-register-imap.c b/src/lib-storage/mail-search-register-imap.c index cc931c2fe0..086a38a9de 100644 --- a/src/lib-storage/mail-search-register-imap.c +++ b/src/lib-storage/mail-search-register-imap.c @@ -301,6 +301,9 @@ imap_search_older(struct mail_search_build_context *ctx) struct mail_search_arg *sarg; sarg = arg_new_interval(ctx, SEARCH_BEFORE); + if (sarg == NULL) + return NULL; + /* we need to match also equal, but SEARCH_BEFORE compares with "<" */ sarg->value.time++; return sarg; -- 2.47.3