From: Miod Vallat Date: Thu, 27 Nov 2025 12:01:35 +0000 (+0100) Subject: Add missing catch block for STL exceptions in createForward. X-Git-Tag: auth-5.0.2~2^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F16566%2Fhead;p=thirdparty%2Fpdns.git Add missing catch block for STL exceptions in createForward. Signed-off-by: Miod Vallat (cherry picked from commit f3d9786ec28a797bb479a7834777f19b55785183) --- diff --git a/pdns/lua-record.cc b/pdns/lua-record.cc index cc8c235ec2..0992e27c7a 100644 --- a/pdns/lua-record.cc +++ b/pdns/lua-record.cc @@ -1093,7 +1093,9 @@ static string lua_createForward() } } return allZerosIP; - } catch (const PDNSException &e) { + } catch (const PDNSException &) { + return allZerosIP; + } catch (const std::exception &) { // thrown by std::stol return allZerosIP; } } diff --git a/regression-tests.auth-py/test_LuaRecords.py b/regression-tests.auth-py/test_LuaRecords.py index b79b7c6a9d..c59e639708 100644 --- a/regression-tests.auth-py/test_LuaRecords.py +++ b/regression-tests.auth-py/test_LuaRecords.py @@ -1085,6 +1085,7 @@ class TestLuaRecords(BaseLuaTest): "ip4041424": "0.0.0.0", "ip-441424": "0.0.0.0", "ip-5abcdef": "0.0.0.0", + "some-text-with-more-than-five-dashes": "0.0.0.0", "host64-22-33-44": "64.22.33.44", "2.2.2.2": "0.0.0.0" # filtered }),