about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/crypt/crypt_sha256.c2
-rw-r--r--src/crypt/crypt_sha512.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/crypt/crypt_sha256.c b/src/crypt/crypt_sha256.c
index d5f0b786..e885dc68 100644
--- a/src/crypt/crypt_sha256.c
+++ b/src/crypt/crypt_sha256.c
@@ -230,7 +230,7 @@ static char *sha256crypt(const char *key, const char *setting, char *output)
 		if (u < ROUNDS_MIN)
 			r = ROUNDS_MIN;
 		else if (u > ROUNDS_MAX)
-			r = ROUNDS_MAX;
+			return 0;
 		else
 			r = u;
 		/* needed when rounds is zero prefixed or out of bounds */
diff --git a/src/crypt/crypt_sha512.c b/src/crypt/crypt_sha512.c
index 1294e98b..39970caf 100644
--- a/src/crypt/crypt_sha512.c
+++ b/src/crypt/crypt_sha512.c
@@ -252,7 +252,7 @@ static char *sha512crypt(const char *key, const char *setting, char *output)
 		if (u < ROUNDS_MIN)
 			r = ROUNDS_MIN;
 		else if (u > ROUNDS_MAX)
-			r = ROUNDS_MAX;
+			return 0;
 		else
 			r = u;
 		/* needed when rounds is zero prefixed or out of bounds */