diff options
author | Lennart Poettering <lennart@poettering.net> | 2023-11-21 09:59:46 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2024-01-04 22:57:04 +0100 |
commit | 42301b6d963dff7ffe36adca9b0a373030a7c5fe (patch) | |
tree | 7e4424170098dc33ecf5be34d1e044297d4231dd /src | |
parent | creds: rename "tpm2-absent" encryption to "null" encryption (diff) | |
download | systemd-42301b6d963dff7ffe36adca9b0a373030a7c5fe.tar.xz systemd-42301b6d963dff7ffe36adca9b0a373030a7c5fe.zip |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/shared/creds-util.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/shared/creds-util.c b/src/shared/creds-util.c index 1c12fdfa9f..22c5e42311 100644 --- a/src/shared/creds-util.c +++ b/src/shared/creds-util.c @@ -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(); |