From 500ea3e92ac34fc3a1113ec0b52b0d93eab25538 Mon Sep 17 00:00:00 2001 From: Miod Vallat Date: Thu, 27 Nov 2025 13:01:35 +0100 Subject: [PATCH] Add missing catch block for STL exceptions in createForward. Signed-off-by: Miod Vallat (cherry picked from commit f3d9786ec28a797bb479a7834777f19b55785183) --- pdns/lua-record.cc | 4 +++- regression-tests.auth-py/test_LuaRecords.py | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) 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 }), -- 2.47.3