nuageinit: add nil/empty guard to decode_base64()

Return an empty string when input is nil or zero-length instead
of processing it through the decoding loop.
This commit is contained in:
Baptiste Daroussin
2026-06-04 20:09:06 +02:00
parent 9459465308
commit 57807f389a
+3
View File
@@ -20,6 +20,9 @@ local function getlocalbase()
end
local function decode_base64(input)
if input == nil or #input == 0 then
return ""
end
local b = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
input = string.gsub(input, '[^'..b..'=]', '')