]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Try to fix unpadded base32 decoding
authorVsevolod Stakhov <vsevolod@rspamd.com>
Fri, 15 Jul 2022 21:26:54 +0000 (22:26 +0100)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Fri, 15 Jul 2022 21:27:50 +0000 (22:27 +0100)
src/libutil/str_util.c

index 81679c2e68d8fb29e07dca2337f71bd284a8bf77..849d11a4f4cffadc7efad9384a3380bb146ee176 100644 (file)
@@ -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) {