creds-util: automatically append NUL byte to decrypted creds

Both as safety net and as convenience feature of a string is contained
in the credential
This commit is contained in:
Lennart Poettering 2023-11-21 09:59:46 +01:00
parent 6d78dc2827
commit 42301b6d96

View file

@ -1376,7 +1376,7 @@ int decrypt_credential_and_warn(
if (ret) {
char *without_metadata;
without_metadata = memdup((uint8_t*) plaintext + hs, plaintext_size - hs);
without_metadata = memdup_suffix0((uint8_t*) plaintext + hs, plaintext_size - hs);
if (!without_metadata)
return log_oom();