From 6139e89b4721abe7e08ea6f8b2313f60642787d3 Mon Sep 17 00:00:00 2001 From: bert hubert Date: Fri, 5 Jun 2015 23:33:26 +0200 Subject: [PATCH] fix up the worst non-sodium breakage --- pdns/dnsdist.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pdns/dnsdist.cc b/pdns/dnsdist.cc index d373e7c39..aa0d6e756 100644 --- a/pdns/dnsdist.cc +++ b/pdns/dnsdist.cc @@ -729,7 +729,8 @@ void doClient(ComboAddress server, const std::string& command) string response; string msg=sodEncryptSym(command, g_key, ours); putMsgLen(fd, msg.length()); - writen2(fd, msg); + if(!msg.empty()) + writen2(fd, msg); uint16_t len; getMsgLen(fd, &len); char resp[len]; @@ -773,8 +774,10 @@ void doClient(ComboAddress server, const std::string& command) writen2(fd, msg); uint16_t len; getMsgLen(fd, &len); + char resp[len]; - readn2(fd, resp, len); + if(len) + readn2(fd, resp, len); msg.assign(resp, len); msg=sodDecryptSym(msg, g_key, theirs); cout<