libxcrypt/libxcrypt-4.4.22-fix_gensalt_yescrypt_o_size_calculation.patch

26 lines
982 B
Diff

From dc75db8c5f17733d4212201f2554e5d5e093c1b3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= <besser82@fedoraproject.org>
Date: Sat, 5 Jun 2021 19:40:39 +0200
Subject: [PATCH] lib/crypt-yescrypt.c: Fix output calculation for
gensalt_yescrypt_rn().
---
lib/crypt-yescrypt.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/crypt-yescrypt.c b/lib/crypt-yescrypt.c
index b2daf16..84b7f19 100644
--- a/lib/crypt-yescrypt.c
+++ b/lib/crypt-yescrypt.c
@@ -106,8 +106,8 @@ gensalt_yescrypt_rn (unsigned long count,
const uint8_t *rbytes, size_t nrbytes,
uint8_t *output, size_t o_size)
{
- if (o_size < 3 + 8 * 6 + BASE64_LEN (nrbytes) + 1 ||
- CRYPT_GENSALT_OUTPUT_SIZE < 3 + 8 * 6 + BASE64_LEN (nrbytes) + 1)
+ if (o_size < 3 + 8 * 6 + 1 + BASE64_LEN (nrbytes) + 1 ||
+ CRYPT_GENSALT_OUTPUT_SIZE < 3 + 8 * 6 + 1 + BASE64_LEN (nrbytes) + 1)
{
errno = ERANGE;
return;