]> granicus.if.org Git - pdns/commitdiff
fix up the worst non-sodium breakage
authorbert hubert <bert.hubert@netherlabs.nl>
Fri, 5 Jun 2015 21:33:26 +0000 (23:33 +0200)
committerbert hubert <bert.hubert@netherlabs.nl>
Tue, 9 Jun 2015 11:14:27 +0000 (13:14 +0200)
pdns/dnsdist.cc

index d373e7c39bf20e01e9ffd9e1f01166da9f107db1..aa0d6e756db185622fe9ad560ae967bafddf49dd 100644 (file)
@@ -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<<msg<<endl;