]> source.dussan.org Git - rspamd.git/commitdiff
Fix allocated_len calculation found by fuzz testing.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 9 Mar 2015 23:44:28 +0000 (23:44 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 9 Mar 2015 23:44:28 +0000 (23:44 +0000)
src/libutil/util.c

index 2a64b9c10615e6fab352ee92af61eb2033fcdb5e..4a125c5602aade8d322781b0535906927e5f0335 100644 (file)
@@ -2203,7 +2203,7 @@ rspamd_decode_base32 (const gchar *in, gsize inlen, gsize *outlen)
        guchar c;
        guint acc = 0U;
        guint processed_bits = 0;
-       gsize olen = 0, i, allocated_len = inlen / 8 * 5 + 2;
+       gsize olen = 0, i, allocated_len = inlen * 5 / 8 + 2;
 
        res = g_malloc (allocated_len);