]> git.ipfire.org Git - thirdparty/pdns.git/commit
dnsdist: Prevent Lua bindings for backend from crashing on empty backend 15707/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 20 Jun 2025 12:06:22 +0000 (14:06 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 30 Jun 2025 15:25:30 +0000 (17:25 +0200)
commita12bea636790a3be73516a2a24af1a8351c016c5
tree4fd9d24bc846c78b40a6612cf13b2edd9b05bfd0
parentf7945074cf2712bade2c6a02d443aeaae7242dd6
dnsdist: Prevent Lua bindings for backend from crashing on empty backend

We currently return an empty `std::shared_ptr` when the backend is not
set (self-answered response, for example), and unfortunately LuaWrapper
is not smart enough to make that equivalent to `nil`, so testing whether
the backend is valid from Lua is not possible. While I would prefer to
fix that, this fix prevents us from crashing when calling the bindings
associated to a backend with an empty shared pointer.

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
pdns/dnsdistdist/dnsdist-lua-bindings.cc