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:
@@ -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..'=]', '')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user