From b8359b365204d12f1300db2fdffe8eddf5d1e309 Mon Sep 17 00:00:00 2001 From: VittGam Date: Tue, 19 Apr 2016 03:58:10 +0000 Subject: [PATCH] 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 --- lib/utils_crypt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/utils_crypt.c b/lib/utils_crypt.c index 6df363b5..c7c98937 100644 --- a/lib/utils_crypt.c +++ b/lib/utils_crypt.c @@ -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; }