From: Otto Moerbeek Date: Wed, 3 May 2023 12:11:20 +0000 (+0200) Subject: Init len earlier, as suggested by rgacogne X-Git-Tag: auth-4.8.0~12^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F12739%2Fhead;p=thirdparty%2Fpdns.git Init len earlier, as suggested by rgacogne --- diff --git a/pdns/recursordist/pdns_recursor.cc b/pdns/recursordist/pdns_recursor.cc index e05ac30776..587821f992 100644 --- a/pdns/recursordist/pdns_recursor.cc +++ b/pdns/recursordist/pdns_recursor.cc @@ -328,12 +328,12 @@ LWResult::Result arecvfrom(PacketBuffer& packet, int /* flags */, const ComboAdd pident->remote = fromaddr; int ret = MT->waitEvent(pident, &packet, g_networkTimeoutMsec, &now); + len = 0; /* -1 means error, 0 means timeout, 1 means a result from handleUDPServerResponse() which might still be an error */ if (ret > 0) { /* handleUDPServerResponse() will close the socket for us no matter what */ if (packet.empty()) { // means "error" - len = 0; return LWResult::Result::PermanentError; }