]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Coverity: 1462718 Unchecked return value from library
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Fri, 1 Apr 2022 10:25:33 +0000 (12:25 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Fri, 1 Apr 2022 10:30:21 +0000 (12:30 +0200)
pdns/lwres.cc

index 1f3124de1dbb34d3a28dcdbd5fd7f0471b83f24a..ba064ec26b2ba9cbc0e7d31d1308568c1ce09674 100644 (file)
@@ -291,7 +291,9 @@ static LWResult::Result tcpsendrecv(const ComboAddress& ip, TCPOutConnectionMana
   const char *lenP = reinterpret_cast<const char*>(&tlen);
 
   localip.sin4.sin_family = ip.sin4.sin_family;
-  getsockname(connection.d_handler->getDescriptor(), reinterpret_cast<sockaddr*>(&localip), &slen);
+  if (getsockname(connection.d_handler->getDescriptor(), reinterpret_cast<sockaddr*>(&localip), &slen) != 0) {
+    return LWResult::Result::PermanentError;
+  }
 
   PacketBuffer packet;
   packet.reserve(2 + vpacket.size());