Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 28 Jun 2026 18:40:21 +0000
From:      Baptiste Daroussin <bapt@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 6fcafba9b365 - stable/15 - nuageinit: add nil/empty guard to decode_base64()
Message-ID:  <6a416a95.1c992.1a5871c3@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch stable/15 has been updated by bapt:

URL: https://cgit.FreeBSD.org/src/commit/?id=6fcafba9b365878f9ba37bfb34ca819c8c848cea

commit 6fcafba9b365878f9ba37bfb34ca819c8c848cea
Author:     Baptiste Daroussin <bapt@FreeBSD.org>
AuthorDate: 2026-06-04 18:09:06 +0000
Commit:     Baptiste Daroussin <bapt@FreeBSD.org>
CommitDate: 2026-06-28 18:32:24 +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.
    
    (cherry picked from commit 57807f389a9e42774d944e256b499f5fd82ff855)
---
 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..'=]', '')
 


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6a416a95.1c992.1a5871c3>