dovecot-2.2-pigeonhole: LDA Sieve plugin: Fixed bug in error han...

pigeonhole at rename-it.nl pigeonhole at rename-it.nl
Mon Dec 14 17:56:34 UTC 2015


details:   http://hg.rename-it.nl/dovecot-2.2-pigeonhole/rev/73667f8d9805
changeset: 2172:73667f8d9805
user:      Stephan Bosch <stephan at rename-it.nl>
date:      Mon Dec 14 18:54:33 2015 +0100
description:
LDA Sieve plugin: Fixed bug in error handling of Sieve storage constructor.
Error code was not passed back to caller, so that it operates on an uninitialized value.
Bug found by CLang warning.

diffstat:

 src/plugins/lda-sieve/lda-sieve-plugin.c |  10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diffs (29 lines):

diff -r a5d17b3a4608 -r 73667f8d9805 src/plugins/lda-sieve/lda-sieve-plugin.c
--- a/src/plugins/lda-sieve/lda-sieve-plugin.c	Mon Dec 14 01:10:44 2015 +0100
+++ b/src/plugins/lda-sieve/lda-sieve-plugin.c	Mon Dec 14 18:54:33 2015 +0100
@@ -174,13 +174,11 @@
 
 static int lda_sieve_get_personal_storage
 (struct sieve_instance *svinst, struct mail_user *user,
-	struct sieve_storage **storage_r)
+	struct sieve_storage **storage_r, enum sieve_error *error_r)
 {
-	enum sieve_error error;
-
-	*storage_r = sieve_storage_create_main(svinst, user, 0, &error);
+	*storage_r = sieve_storage_create_main(svinst, user, 0, error_r);
 	if (*storage_r == NULL) {
-		switch (error) {
+		switch (*error_r) {
 		case SIEVE_ERROR_NOT_POSSIBLE:
 		case SIEVE_ERROR_NOT_FOUND:
 			break;
@@ -639,7 +637,7 @@
 	/* Find the personal script to execute */
 
 	ret = lda_sieve_get_personal_storage
-		(svinst, mdctx->dest_user, &main_storage);
+		(svinst, mdctx->dest_user, &main_storage, &error);
 	if ( ret == 0 && error == SIEVE_ERROR_NOT_POSSIBLE )
 		return 0;
 	if ( ret > 0 ) {


More information about the dovecot-cvs mailing list