From 3a23cd0f2683a31389f7027f8a2e8f9ade0f8ffb Mon Sep 17 00:00:00 2001 From: bert hubert Date: Wed, 12 Apr 2017 11:42:14 +0200 Subject: [PATCH] check new key before replacing old one. --- pdns/dnsdist-lua.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pdns/dnsdist-lua.cc b/pdns/dnsdist-lua.cc index 7372ec3a85..4ac1121114 100644 --- a/pdns/dnsdist-lua.cc +++ b/pdns/dnsdist-lua.cc @@ -1467,11 +1467,13 @@ vector> setupLua(bool client, const std::string& confi } setLuaSideEffect(); - g_key.clear(); - if(B64Decode(key, g_key) < 0) { + string newkey; + if(B64Decode(key, newkey) < 0) { g_outputBuffer=string("Unable to decode ")+key+" as Base64"; errlog("%s", g_outputBuffer); } + else + g_key=newkey; }); -- 2.47.2