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:
VittGam
2016-04-19 03:58:10 +00:00
parent b5365ba13d
commit e7e5354332

View File

@@ -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;
}