diff options
| author | Baptiste Daroussin <bapt@FreeBSD.org> | 2026-06-04 18:09:06 +0000 |
|---|---|---|
| committer | Baptiste Daroussin <bapt@FreeBSD.org> | 2026-06-04 18:09:06 +0000 |
| commit | 57807f389a9e42774d944e256b499f5fd82ff855 (patch) | |
| tree | 3c95c023321e947e43a653b5c42a9f78e2be5c32 | |
| parent | 9459465308ff17a11cad1c3d1987951055f114d6 (diff) | |
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.
| -rw-r--r-- | libexec/nuageinit/nuage.lua | 3 |
1 files changed, 3 insertions, 0 deletions
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..'=]', '') |
