mirror of
https://github.com/libvirt/libvirt.git
synced 2026-10-02 12:20:06 -05:00
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:
1 parent
58b3a78aff
commit
747a74dd05
1 file changed
-3
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user