dovecot-2.1-pigeonhole: lib-sieve: editheader extension: added r...

pigeonhole at rename-it.nl pigeonhole at rename-it.nl
Sat Nov 26 12:11:50 EET 2011


details:   http://hg.rename-it.nl/dovecot-2.1-pigeonhole/rev/a691c5c035f2
changeset: 1552:a691c5c035f2
user:      Stephan Bosch <stephan at rename-it.nl>
date:      Sat Nov 26 11:11:02 2011 +0100
description:
lib-sieve: editheader extension: added runtime header field name verification.

diffstat:

 src/lib-sieve/plugins/editheader/cmd-addheader.c    |  11 +++++++++++
 src/lib-sieve/plugins/editheader/cmd-deleteheader.c |  11 +++++++++++
 2 files changed, 22 insertions(+), 0 deletions(-)

diffs (42 lines):

diff -r cdf52ef61f65 -r a691c5c035f2 src/lib-sieve/plugins/editheader/cmd-addheader.c
--- a/src/lib-sieve/plugins/editheader/cmd-addheader.c	Sat Nov 26 11:09:58 2011 +0100
+++ b/src/lib-sieve/plugins/editheader/cmd-addheader.c	Sat Nov 26 11:11:02 2011 +0100
@@ -239,6 +239,17 @@
 		return ret;
 
 	/*
+	 * Verify arguments
+	 */
+
+	if ( !rfc2822_header_field_name_verify
+		(str_c(field_name), str_len(field_name)) ) {
+		sieve_runtime_error(renv, NULL, "specified field name `%s' is invalid",
+			str_sanitize(str_c(field_name), 80));
+		return SIEVE_EXEC_FAILURE;
+	}
+
+	/*
 	 * Perform operation
 	 */
 
diff -r cdf52ef61f65 -r a691c5c035f2 src/lib-sieve/plugins/editheader/cmd-deleteheader.c
--- a/src/lib-sieve/plugins/editheader/cmd-deleteheader.c	Sat Nov 26 11:09:58 2011 +0100
+++ b/src/lib-sieve/plugins/editheader/cmd-deleteheader.c	Sat Nov 26 11:11:02 2011 +0100
@@ -426,6 +426,17 @@
 		return ret;
 	
 	/*
+	 * Verify arguments
+	 */
+
+	if ( !rfc2822_header_field_name_verify
+		(str_c(field_name), str_len(field_name)) ) {
+		sieve_runtime_error(renv, NULL, "specified field name `%s' is invalid",
+			str_sanitize(str_c(field_name), 80));
+		return SIEVE_EXEC_FAILURE;
+	}
+
+	/*
 	 * Execute command
 	 */
 


More information about the dovecot-cvs mailing list