From ae7049063c4c76d4c4a234a1a2eb7b547e843402 Mon Sep 17 00:00:00 2001 From: Wouter Wijngaards Date: Tue, 15 Jul 2014 14:42:57 +0000 Subject: [PATCH] - Fix #596: Bail out of unbound-control list_local_zones when ssl write fails. git-svn-id: file:///svn/unbound/trunk@3193 be551aaa-1e26-0410-a405-d3ace91eadb9 --- daemon/remote.c | 9 +++++++-- doc/Changelog | 4 ++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/daemon/remote.c b/daemon/remote.c index f93698080..46922e467 100644 --- a/daemon/remote.c +++ b/daemon/remote.c @@ -2088,8 +2088,13 @@ do_list_local_zones(SSL* ssl, struct worker* worker) RBTREE_FOR(z, struct local_zone*, &zones->ztree) { lock_rw_rdlock(&z->lock); dname_str(z->name, buf); - (void)ssl_printf(ssl, "%s %s\n", buf, - local_zone_type2str(z->type)); + if(!ssl_printf(ssl, "%s %s\n", buf, + local_zone_type2str(z->type))) { + /* failure to print */ + lock_rw_unlock(&z->lock); + lock_rw_unlock(&zones->lock); + return; + } lock_rw_unlock(&z->lock); } lock_rw_unlock(&zones->lock); diff --git a/doc/Changelog b/doc/Changelog index 39db2df31..705073087 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,3 +1,7 @@ +15 July 2014: Wouter + - Fix #596: Bail out of unbound-control list_local_zones when ssl + write fails. + 13 July 2014: Wouter - Configure tests if main can be linked to from getentropy compat.