]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Add missing catch block for STL exceptions in createForward. 16566/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 13:02:02 +0000 (14:02 +0100)
Signed-off-by: Miod Vallat <miod.vallat@powerdns.com>
(cherry picked from commit f3d9786ec28a797bb479a7834777f19b55785183)

pdns/lua-record.cc
regression-tests.auth-py/test_LuaRecords.py

index cc8c235ec2de9347d2ca0720fd4844adc1842f15..0992e27c7a7e42114c2d2acc58c34a8aa00cd292 100644 (file)
@@ -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;
   }
 }
index b79b7c6a9d8fc7c5a47462dfb375535c19c45fe8..c59e639708f5cf6b69e206b428c07b8d489789ad 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
             }),