commit ca32640: [Minor] Try to fix unpadded base32 decoding

Vsevolod Stakhov vsevolod at rspamd.com
Fri Jul 15 21:28:03 UTC 2022


Author: Vsevolod Stakhov
Date: 2022-07-15 22:26:54 +0100
URL: https://github.com/rspamd/rspamd/commit/ca32640e2372f97314dc65e9b40af718588753d6 (HEAD -> master)

[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) {


More information about the Commits mailing list