git: 57807f389a9e - main - nuageinit: add nil/empty guard to decode_base64()
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 04 Jun 2026 21:15:42 UTC
The branch main has been updated by bapt:
URL: https://cgit.FreeBSD.org/src/commit/?id=57807f389a9e42774d944e256b499f5fd82ff855
commit 57807f389a9e42774d944e256b499f5fd82ff855
Author: Baptiste Daroussin <bapt@FreeBSD.org>
AuthorDate: 2026-06-04 18:09:06 +0000
Commit: Baptiste Daroussin <bapt@FreeBSD.org>
CommitDate: 2026-06-04 18:09:06 +0000
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.
---
libexec/nuageinit/nuage.lua | 3 +++
1 file changed, 3 insertions(+)
diff --git a/libexec/nuageinit/nuage.lua b/libexec/nuageinit/nuage.lua
index 839cf3588021..4f25e79ccefc 100644
--- a/libexec/nuageinit/nuage.lua
+++ b/libexec/nuageinit/nuage.lua
@@ -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..'=]', '')