dovecot-2.2: zlib: Don't crash when trying to use zlib_save for ...

dovecot at dovecot.org dovecot at dovecot.org
Mon Apr 15 21:40:47 EEST 2013


details:   http://hg.dovecot.org/dovecot-2.2/rev/9a5b132b6832
changeset: 16289:9a5b132b6832
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Apr 15 21:40:35 2013 +0300
description:
zlib: Don't crash when trying to use zlib_save for handler that isn't compiled in.

diffstat:

 src/plugins/zlib/zlib-plugin.c |  4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diffs (14 lines):

diff -r b38d5ebacf25 -r 9a5b132b6832 src/plugins/zlib/zlib-plugin.c
--- a/src/plugins/zlib/zlib-plugin.c	Mon Apr 15 17:22:06 2013 +0300
+++ b/src/plugins/zlib/zlib-plugin.c	Mon Apr 15 21:40:35 2013 +0300
@@ -295,6 +295,10 @@
 		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) {


More information about the dovecot-cvs mailing list