From: Miod Vallat Date: Thu, 18 Dec 2025 09:24:44 +0000 (+0100) Subject: Add missing exception guard to lua createReverse. X-Git-Tag: rec-5.4.0-beta1~85^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b82c7d98e3714ae3720ed21690aef6ea6575a4da;p=thirdparty%2Fpdns.git Add missing exception guard to lua createReverse. While there, amend the exception messages in createReverse and createReverse6 to be a bit more precise and identify which function produced them. Signed-off-by: Miod Vallat --- diff --git a/pdns/lua-record.cc b/pdns/lua-record.cc index a4b5c647f9..fcbc95d098 100644 --- a/pdns/lua-record.cc +++ b/pdns/lua-record.cc @@ -985,8 +985,6 @@ static string lua_createReverse(const string &format, boost::optional ex return {"unknown"}; } - vector candidates; - // so, query comes in for 4.3.2.1.in-addr.arpa, zone is called 2.1.in-addr.arpa // exceptions["1.2.3.4"]="bert.powerdns.com" then provides an exception if (exceptions) { @@ -1014,7 +1012,10 @@ static string lua_createReverse(const string &format, boost::optional ex return fmt.str(); } catch(std::exception& ex) { - g_log< exceptions) { - vector candidates; - try { auto labels= s_lua_record_ctx->qname.getRawLabels(); if (labels.size()<32) { @@ -1200,12 +1199,12 @@ static string lua_createReverse6(const string &format, boost::optional e return fmt.str(); } catch(std::exception& ex) { - g_log< lua_filterForward(const string& address, NetmaskGroup& nmg, boost::optional fallback)