From: Timo Sirainen Date: Tue, 6 Jul 2010 12:44:48 +0000 (+0100) Subject: lib-storage: Don't crash if invalid parameter is given to SEARCH OLDER. X-Git-Tag: 2.0.rc2~31 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b2c7d290a3910b0da4b0b429dc2efc1ccfc20589;p=thirdparty%2Fdovecot%2Fcore.git lib-storage: Don't crash if invalid parameter is given to SEARCH OLDER. --HG-- branch : HEAD --- 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;