From 227a3dbf96b1c9ab4e6e3814982991be78786248 Mon Sep 17 00:00:00 2001 From: Charles-Henri Bruyand Date: Sat, 12 Oct 2024 21:10:36 +0200 Subject: [PATCH] dnsdist setTicketsKeyAddedHook: pass a std::string to the hook to avoid luawrapper to truncate content at potential null chars --- pdns/dnsdistdist/dnsdist-lua-hooks.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pdns/dnsdistdist/dnsdist-lua-hooks.cc b/pdns/dnsdistdist/dnsdist-lua-hooks.cc index 2904cd3792..8bdff2e17c 100644 --- a/pdns/dnsdistdist/dnsdist-lua-hooks.cc +++ b/pdns/dnsdistdist/dnsdist-lua-hooks.cc @@ -7,7 +7,7 @@ namespace dnsdist::lua::hooks { using MaintenanceCallback = std::function; -using TicketsKeyAddedHook = std::function; +using TicketsKeyAddedHook = std::function; static LockGuarded> s_maintenanceHooks; @@ -35,7 +35,7 @@ static void setTicketsKeyAddedHook(const LuaContext& context, const TicketsKeyAd TLSCtx::setTicketsKeyAddedHook([hook](const std::string& key) { try { auto lua = g_lua.lock(); - hook(key.c_str(), key.size()); + hook(key, key.size()); } catch (const std::exception& exp) { warnlog("Error calling the Lua hook after new tickets key has been added: %s", exp.what()); -- 2.47.2