mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-05 16:00:05 +01:00
Fix UTF16 buffer overflow in bitlk volume key dump.
It is UTF16, so even the terminating character is char16_t. (Found by gcc sanitizer.)
This commit is contained in:
@@ -969,7 +969,7 @@ static int bitlk_kdf(struct crypt_device *cd,
|
||||
|
||||
if (!recovery) {
|
||||
/* passphrase: convert to UTF-16 first, then sha256(sha256(pw)) */
|
||||
utf16Password = crypt_safe_alloc(sizeof(char16_t) * passwordLen + 1);
|
||||
utf16Password = crypt_safe_alloc(sizeof(char16_t) * (passwordLen + 1));
|
||||
if (!utf16Password) {
|
||||
r = -ENOMEM;
|
||||
goto out;
|
||||
|
||||
Reference in New Issue
Block a user