Commit e7e53543 authored by VittGam's avatar VittGam

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: default avatarVittorio Gambaletta <git-cryptsetup@vittgam.net>
parent b5365ba1
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment