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 <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
Peter Krempa committed 2026-03-27 11:44:25 +01:00
1 parent 58b3a78aff
commit 747a74dd05
1 file changed
-3
-3
View File
@@ -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);