]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
zlib: Don't crash when trying to use zlib_save for handler that isn't compiled in.
authorTimo Sirainen <tss@iki.fi>
Mon, 15 Apr 2013 18:40:35 +0000 (21:40 +0300)
committerTimo Sirainen <tss@iki.fi>
Mon, 15 Apr 2013 18:40:35 +0000 (21:40 +0300)
src/plugins/zlib/zlib-plugin.c

index 7ea4e9dfdc1015bb8a7910647b26653d9827bfc8..d54ea54e7d98124194ceac51ee8a3f0c9a12f20a 100644 (file)
@@ -295,6 +295,10 @@ static void zlib_mail_user_created(struct mail_user *user)
                zuser->save_handler = compression_lookup_handler(name);
                if (zuser->save_handler == NULL)
                        i_error("zlib_save: Unknown handler: %s", name);
+               else if (zuser->save_handler->create_ostream == NULL) {
+                       i_error("zlib_save: Support not compiled in for handler: %s", name);
+                       zuser->save_handler = NULL;
+               }
        }
        name = mail_user_plugin_getenv(user, "zlib_save_level");
        if (name != NULL) {