From ca32640e2372f97314dc65e9b40af718588753d6 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Fri, 15 Jul 2022 22:26:54 +0100 Subject: [PATCH] [Minor] Try to fix unpadded base32 decoding --- src/libutil/str_util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libutil/str_util.c b/src/libutil/str_util.c index 81679c2e6..849d11a4f 100644 --- a/src/libutil/str_util.c +++ b/src/libutil/str_util.c @@ -1008,7 +1008,7 @@ rspamd_decode_base32_buf (const gchar *in, gsize inlen, guchar *out, gsize outle } } - if (processed_bits > 0 && o < end) { + if (processed_bits > 0 && o < end && acc != 0) { *o++ = (acc & 0xFF); } else if (o > end) { -- 2.39.5