From: Miod Vallat Date: Thu, 18 Dec 2025 09:24:44 +0000 (+0100) Subject: Add missing exception guard to lua createReverse. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1e599af652699c84dfefb37176fc14f9370fd8a7;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 (cherry picked from commit b82c7d98e3714ae3720ed21690aef6ea6575a4da) --- diff --git a/pdns/lua-record.cc b/pdns/lua-record.cc index 0992e27c7a..a14094122c 100644 --- a/pdns/lua-record.cc +++ b/pdns/lua-record.cc @@ -999,8 +999,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) { @@ -1028,7 +1026,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) { @@ -1214,12 +1213,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)