From 0c6e4870cecd40f31b5586d1459d61923fd62470 Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Wed, 3 May 2023 14:11:20 +0200 Subject: [PATCH] Init len earlier, as suggested by rgacogne --- pdns/recursordist/pdns_recursor.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- 2.47.2