]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Add missing catch block for STL exceptions in createForward. 16564/head
authorMiod Vallat <miod.vallat@powerdns.com>
Thu, 27 Nov 2025 12:01:35 +0000 (13:01 +0100)
committerMiod Vallat <miod.vallat@powerdns.com>
Thu, 27 Nov 2025 12:08:21 +0000 (13:08 +0100)
Signed-off-by: Miod Vallat <miod.vallat@powerdns.com>
pdns/lua-record.cc
regression-tests.auth-py/test_LuaRecords.py

index 1ddf071042051f00f73f524f6959b03edb3f6979..a4b5c647f91aa142745c55c903cb5dae67354dcf 100644 (file)
@@ -1079,7 +1079,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;
   }
 }
index b0340ad8d22a666efe1ab876244911a3558584a7..0e04d3fad0780cc53f659a56a4d46aeb3ac71a68 100644 (file)
@@ -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
             }),