From 747a74dd05518fec0617c86752580a02d9e94fe4 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Fri, 27 Mar 2026 09:35:15 +0100 Subject: [PATCH] virSecretLoadValue: Don't re-termiante the buffer The buffer returned from 'virFileReadAll' is NUL terminated no need to do it explicitly or to shorten it since this is now also done. Signed-off-by: Peter Krempa Reviewed-by: Pavel Hrdina --- src/conf/virsecretobj.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/conf/virsecretobj.c b/src/conf/virsecretobj.c index b448be493a..82a61a747a 100644 --- a/src/conf/virsecretobj.c +++ b/src/conf/virsecretobj.c @@ -908,9 +908,6 @@ virSecretLoadValue(virSecretObj *obj, if ((filelen = virFileReadAll(filename, secretFileMaxLen, &filecontent)) < 0) return -1; - filecontent = g_realloc(filecontent, filelen + 1); - filecontent[filelen] = '\0'; - decoded = g_base64_decode(filecontent, &decodedlen); virSecureErase(filecontent, filelen);