dovecot-2.1-pigeonhole: lib-sieve: variables extension: Fixed co...

pigeonhole at rename-it.nl pigeonhole at rename-it.nl
Mon Sep 16 01:56:10 EEST 2013


details:   http://hg.rename-it.nl/dovecot-2.1-pigeonhole/rev/aadc77880254
changeset: 1699:aadc77880254
user:      Stephan Bosch <stephan at rename-it.nl>
date:      Mon Sep 16 00:55:29 2013 +0200
description:
lib-sieve: variables extension: Fixed code corruption bug in 'set' command.
Bug whould occur when modifier was used and the value became "" at some point. In that case not all operands (modifiers) were read, causing the subsequent operation to start at an erroneous position.

diffstat:

 src/lib-sieve/plugins/variables/cmd-set.c |  18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diffs (30 lines):

diff -r 5b4b8d0cf0f3 -r aadc77880254 src/lib-sieve/plugins/variables/cmd-set.c
--- a/src/lib-sieve/plugins/variables/cmd-set.c	Mon Sep 16 00:46:21 2013 +0200
+++ b/src/lib-sieve/plugins/variables/cmd-set.c	Mon Sep 16 00:55:29 2013 +0200
@@ -316,17 +316,17 @@
 		str_truncate(value, EXT_VARIABLES_MAX_VARIABLE_SIZE);
 
 	/* Apply modifiers if necessary (sorted during code generation already) */
-	if ( str_len(value) > 0 ) {
-		for ( i = 0; i < mdfs; i++ ) {
-			string_t *new_value;
-			struct sieve_variables_modifier modf;
+	for ( i = 0; i < mdfs; i++ ) {
+		string_t *new_value;
+		struct sieve_variables_modifier modf;
 
-			if ( !ext_variables_opr_modifier_read(renv, address, &modf) ) {
-				value = NULL;
-				ret = SIEVE_EXEC_BIN_CORRUPT;
-				break;
-			}
+		if ( !ext_variables_opr_modifier_read(renv, address, &modf) ) {
+			value = NULL;
+			ret = SIEVE_EXEC_BIN_CORRUPT;
+			break;
+		}
 
+		if ( str_len(value) > 0 ) {
 			if ( modf.def != NULL && modf.def->modify != NULL ) {
 				if ( !modf.def->modify(value, &new_value) ) {
 					value = NULL;


More information about the dovecot-cvs mailing list