From: bert hubert Date: Fri, 5 Jun 2015 21:33:26 +0000 (+0200) Subject: fix up the worst non-sodium breakage X-Git-Tag: dnsdist-1.0.0-alpha1~248^2~78^2~19^2^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6139e89b4721abe7e08ea6f8b2313f60642787d3;p=thirdparty%2Fpdns.git fix up the worst non-sodium breakage --- diff --git a/pdns/dnsdist.cc b/pdns/dnsdist.cc index d373e7c39b..aa0d6e756d 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<