diff --git a/TODO b/TODO index 07bcd6632f3432381286eaa9f964386af4c957d7..2d4920c9447669c87a5b7124ce81fcf7a8a998e7 100644 --- a/TODO +++ b/TODO @@ -4,7 +4,6 @@ Next (in order of descending priority/precedence): * Make sure cmusieve can be replaced seamlessly with the new plugin. * Final issues: - FIXME hunting - - 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); } }