]> granicus.if.org Git - pdns/commitdiff
ixfrdist: initialize fromlen
authorPieter Lexis <pieter.lexis@powerdns.com>
Thu, 18 Jan 2018 12:52:50 +0000 (13:52 +0100)
committerPieter Lexis <pieter.lexis@powerdns.com>
Mon, 29 Jan 2018 08:20:14 +0000 (09:20 +0100)
pdns/ixfrdist.cc

index 887fb34ddcf1a4a10090b3b3b358fa5eb191f9f8..00242e2b6f1bb16f650825b0b65cb7db5b60b442 100644 (file)
@@ -294,7 +294,7 @@ void handleUDPRequest(int fd, boost::any&) {
   // TODO make the buffer-size configurable
   char buf[4096];
   ComboAddress saddr;
-  socklen_t fromlen;
+  socklen_t fromlen = sizeof(saddr);
   int res = recvfrom(fd, buf, sizeof(buf), 0, (struct sockaddr*) &saddr, &fromlen);
 
   if (res == 0) {
@@ -329,7 +329,7 @@ void handleUDPRequest(int fd, boost::any&) {
 
 void handleTCPRequest(int fd, boost::any&) {
   ComboAddress saddr;
-  socklen_t socklen;
+  socklen_t socklen = sizeof(saddr);
 
   int cfd = accept(fd, (sockaddr*) &saddr, &socklen);