diff --git a/TODO b/TODO
index b7f0e6a0f2a2471cc82340f8f5ec8034cf77749b..abc6eb0b3b6bd5494b602fd41719a0d0e96a350c 100644
--- a/TODO
+++ b/TODO
@@ -5,7 +5,6 @@ Next (in order of descending priority/precedence):
 	- Variables: dump variable identifiers in stead of storage indexes
 * Make sure cmusieve can be replaced seamlessly with the new plugin.
 * Final issues:
-	- Fix amd64 logging segfault
 	- Fix/Report issues listed in 'doc/rfc/RFC Controversy.txt'
 
 
diff --git a/src/lib-sieve/sieve-error.c b/src/lib-sieve/sieve-error.c
index c43d698c1ecc599bf08a59b758130f93f12552d9..2ea76d52741c16978d49b5e6ec7d507d80137bac 100644
--- a/src/lib-sieve/sieve-error.c
+++ b/src/lib-sieve/sieve-error.c
@@ -53,10 +53,14 @@ void sieve_verror
 	if ( ehandler == NULL ) return;
 	
 	if ( ehandler->log_master ) {
+		va_list args_copy;
+
+		VA_COPY(args_copy, args);
+
 		if ( location == NULL || *location == '\0' )
-			sieve_sys_error("%s", t_strdup_vprintf(fmt, args));
+			sieve_sys_error("%s", t_strdup_vprintf(fmt, args_copy));
 		else
-			sieve_sys_error("%s: %s", location, t_strdup_vprintf(fmt, args));
+			sieve_sys_error("%s: %s", location, t_strdup_vprintf(fmt, args_copy));
 	}
 
 	if ( sieve_errors_more_allowed(ehandler) ) {
@@ -73,10 +77,14 @@ void sieve_vwarning
 	if ( ehandler == NULL ) return;
 
 	if ( ehandler->log_master ) {
+		va_list args_copy;
+
+		VA_COPY(args_copy, args);
+
 		if ( location == NULL || *location == '\0' )
-			sieve_sys_warning("%s", t_strdup_vprintf(fmt, args));
+			sieve_sys_warning("%s", t_strdup_vprintf(fmt, args_copy));
 		else
-			sieve_sys_warning("%s: %s", location, t_strdup_vprintf(fmt, args));
+			sieve_sys_warning("%s: %s", location, t_strdup_vprintf(fmt, args_copy));
 	}
 	
 	if ( ehandler->vwarning != NULL )	
@@ -91,10 +99,15 @@ void sieve_vinfo
 	if ( ehandler == NULL ) return;
 
 	if ( ehandler->log_master ) {
+		va_list args_copy;
+
+		VA_COPY(args_copy, args);
+
+
 		if ( location == NULL || *location == '\0' )
-			sieve_sys_info("%s", t_strdup_vprintf(fmt, args));
+			sieve_sys_info("%s", t_strdup_vprintf(fmt, args_copy));
 		else	
-			sieve_sys_info("%s: %s", location, t_strdup_vprintf(fmt, args));
+			sieve_sys_info("%s: %s", location, t_strdup_vprintf(fmt, args_copy));
 	}
 	
 	if ( ehandler->log_info && ehandler->vinfo != NULL )	
@@ -349,7 +362,7 @@ struct sieve_logfile_ehandler {
 
 static void sieve_logfile_vprintf
 (struct sieve_logfile_ehandler *ehandler, const char *location, 
-	const char *prefix,	const char *fmt, va_list args) 
+	const char *prefix, const char *fmt, va_list args) 
 {
 	string_t *outbuf;
 	ssize_t ret = 0, remain;
@@ -379,7 +392,7 @@ static void sieve_logfile_vprintf
 
 	if ( ret < 0 ) {
 		sieve_sys_error(
-			"o_stream_send() failed on logfile %s: %m",	ehandler->logfile);		
+			"o_stream_send() failed on logfile %s: %m", ehandler->logfile);		
 	}
 }