]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Don't crash if invalid parameter is given to SEARCH OLDER.
authorTimo Sirainen <tss@iki.fi>
Tue, 6 Jul 2010 12:44:48 +0000 (13:44 +0100)
committerTimo Sirainen <tss@iki.fi>
Tue, 6 Jul 2010 12:44:48 +0000 (13:44 +0100)
--HG--
branch : HEAD

src/lib-storage/mail-search-register-imap.c

index cc931c2fe0e3327110bec3dee0637a038b25b64a..086a38a9de0df1e4a60a8081a5ba238ddbc86e32 100644 (file)
@@ -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;