mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-05 16:00:05 +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:
@@ -220,7 +220,7 @@ int crypt_keyfile_read(struct crypt_device *cd, const char *keyfile,
|
||||
|
||||
/* If not requsted otherwise, we limit input to prevent memory exhaustion */
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user