dovecot-2.0: config reading: Don't crash if caller specified mod...

dovecot at dovecot.org dovecot at dovecot.org
Mon Feb 22 16:49:12 EET 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/5e6f64050daa
changeset: 10801:5e6f64050daa
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Feb 22 16:49:08 2010 +0200
description:
config reading: Don't crash if caller specified module=NULL or service=NULL.

diffstat:

 src/lib-master/master-service-settings-cache.c |  4 ++--
 src/lib-storage/mail-storage-service.c         |  4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diffs (28 lines):

diff -r 8aaf030ae510 -r 5e6f64050daa src/lib-master/master-service-settings-cache.c
--- a/src/lib-master/master-service-settings-cache.c	Sat Feb 20 18:30:36 2010 +0200
+++ b/src/lib-master/master-service-settings-cache.c	Mon Feb 22 16:49:08 2010 +0200
@@ -252,8 +252,8 @@
 	struct master_service_settings_output output;
 	const struct master_service_settings *set;
 
-	i_assert(strcmp(input->module, cache->module) == 0);
-	i_assert(strcmp(input->service, cache->service_name) == 0);
+	i_assert(null_strcmp(input->module, cache->module) == 0);
+	i_assert(null_strcmp(input->service, cache->service_name) == 0);
 
 	if (cache_find(cache, input, parser_r))
 		return 0;
diff -r 8aaf030ae510 -r 5e6f64050daa src/lib-storage/mail-storage-service.c
--- a/src/lib-storage/mail-storage-service.c	Sat Feb 20 18:30:36 2010 +0200
+++ b/src/lib-storage/mail-storage-service.c	Mon Feb 22 16:49:08 2010 +0200
@@ -631,8 +631,8 @@
 						  &ctx->set_cache_dyn_parsers);
 	}
 
-	if (strcmp(input->module, ctx->set_cache_module) == 0 &&
-	    strcmp(input->service, ctx->set_cache_service) == 0) {
+	if (null_strcmp(input->module, ctx->set_cache_module) == 0 &&
+	    null_strcmp(input->service, ctx->set_cache_service) == 0) {
 		set_input.roots = ctx->set_cache_roots;
 		set_input.dyn_parsers = ctx->set_cache_dyn_parsers;
 		set_input.dyn_parsers_parent =


More information about the dovecot-cvs mailing list