diff options
author | Thomas Haller <thaller@redhat.com> | 2018-08-31 07:51:10 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2018-09-04 07:38:30 +0200 |
commit | 10724b38a884eabdccc90064c5c0f78c9c9a4a07 (patch) | |
tree | aa3d3c95027dc4bebcb6cff28433d841ede6c893 | |
parent | 2456298da02579ca87b836d6552779c8803cfce2 (diff) | |
download | NetworkManager-10724b38a884eabdccc90064c5c0f78c9c9a4a07.tar.gz |
libnm/crypto: don't initialize buffer for nm_crypto_make_des_aes_key() with zero
@key is directly passed to nm_crypto_md5_hash(), which cannot (by API design)
fail. No need to initialize it.
Also, no need to allocate an additional trailing NUL byte. The key is
binary, every attempt to use it as a string will horribly fail.
-rw-r--r-- | libnm-core/nm-crypto.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libnm-core/nm-crypto.c b/libnm-core/nm-crypto.c index 5fc5fc8b91..1bd7236cf2 100644 --- a/libnm-core/nm-crypto.c +++ b/libnm-core/nm-crypto.c @@ -458,7 +458,7 @@ nm_crypto_make_des_aes_key (const char *cipher, if (password[0] == '\0') return NULL; - key = g_malloc0 (digest_len + 1); + key = g_malloc (digest_len); nm_crypto_md5_hash (salt, 8, |