mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-14 20:30:04 +01:00
Fix off-by-one error in maximum keyfile size.
Allow keyfiles up to DEFAULT_KEYFILE_SIZE_MAXKB * 1024 bytes in size, and not that value minus one. Signed-off-by: Vittorio Gambaletta <git-cryptsetup@vittgam.net>
This commit is contained in:
@@ -360,7 +360,7 @@ int crypt_get_key(const char *prompt,
|
|||||||
|
|
||||||
/* If not requsted otherwise, we limit input to prevent memory exhaustion */
|
/* If not requsted otherwise, we limit input to prevent memory exhaustion */
|
||||||
if (keyfile_size_max == 0) {
|
if (keyfile_size_max == 0) {
|
||||||
keyfile_size_max = DEFAULT_KEYFILE_SIZE_MAXKB * 1024;
|
keyfile_size_max = DEFAULT_KEYFILE_SIZE_MAXKB * 1024 + 1;
|
||||||
unlimited_read = 1;
|
unlimited_read = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user