Do not use uninitialized memory for cipher check.

We do not care about the bufer content, but valgrind do, just wipe
the buffer before test.
This commit is contained in:
Milan Broz
2022-07-05 11:11:46 +02:00
parent 5904516122
commit 914f621251

View File

@@ -49,6 +49,7 @@ int LUKS2_check_cipher(struct crypt_device *cd,
if (r < 0)
goto out;
memset(buf, 0, sizeof(buf));
r = crypt_storage_decrypt(s, 0, sizeof(buf), buf);
crypt_storage_destroy(s);
out: