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
committed by Milan Broz
parent 75eaac3fef
commit b8359b3652

View File

@@ -360,7 +360,7 @@ int crypt_get_key(const char *prompt,
/* 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;
}