dovecot-2.2: lib-http: Previous test-http-client safe_memset() c...

dovecot at dovecot.org dovecot at dovecot.org
Tue Aug 18 18:11:31 UTC 2015


details:   http://hg.dovecot.org/dovecot-2.2/rev/04be746494dc
changeset: 18968:04be746494dc
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Aug 18 21:10:41 2015 +0300
description:
lib-http: Previous test-http-client safe_memset() change broke in some systems.
Since there's no easy way to fix this in Makefile.am, just do it by actually
using safe_memset()..

diffstat:

 src/lib-http/Makefile.am        |  1 -
 src/lib-http/test-http-client.c |  8 ++++++--
 2 files changed, 6 insertions(+), 3 deletions(-)

diffs (36 lines):

diff -r 5be374f2b1d8 -r 04be746494dc src/lib-http/Makefile.am
--- a/src/lib-http/Makefile.am	Tue Aug 18 20:59:25 2015 +0300
+++ b/src/lib-http/Makefile.am	Tue Aug 18 21:10:41 2015 +0300
@@ -139,7 +139,6 @@
 	../lib-ssl-iostream/libssl_iostream.la \
 	../lib-master/libmaster.la \
 	../lib-settings/libsettings.la \
-	../lib/safe-memset.lo \
 	$(test_libs)
 test_http_client_DEPENDENCIES = \
 	libhttp.la \
diff -r 5be374f2b1d8 -r 04be746494dc src/lib-http/test-http-client.c
--- a/src/lib-http/test-http-client.c	Tue Aug 18 20:59:25 2015 +0300
+++ b/src/lib-http/test-http-client.c	Tue Aug 18 21:10:41 2015 +0300
@@ -1,6 +1,7 @@
 /* Copyright (c) 2013-2015 Dovecot authors, see the included COPYING file */
 
 #include "lib.h"
+#include "safe-memset.h"
 #include "ioloop.h"
 #include "istream.h"
 #include "write-full.h"
@@ -342,8 +343,11 @@
 	ioloop = io_loop_create();
 	io_loop_set_running(ioloop);
 
-
-	memset(&dns_set, 0, sizeof(dns_set));
+	/* kludge: use safe_memset() here since otherwise it's not included in
+	   the binary in all systems (but is in others! so linking
+	   safe-memset.lo directly causes them to fail.) If safe_memset() isn't
+	   included, libssl-iostream plugin loading fails. */
+	safe_memset(&dns_set, 0, sizeof(dns_set));
 	dns_set.dns_client_socket_path = "/var/run/dovecot/dns-client";
 	dns_set.timeout_msecs = 30*1000;
 	dns_set.idle_timeout_msecs = UINT_MAX;


More information about the dovecot-cvs mailing list