From: Vsevolod Stakhov Date: Mon, 9 Mar 2015 23:44:28 +0000 (+0000) Subject: Fix allocated_len calculation found by fuzz testing. X-Git-Tag: 0.9.0~530 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=7bbf934bd25b81aee2d87679cb48d4fae5202706;p=rspamd.git Fix allocated_len calculation found by fuzz testing. --- diff --git a/src/libutil/util.c b/src/libutil/util.c index 2a64b9c10..4a125c560 100644 --- a/src/libutil/util.c +++ b/src/libutil/util.c @@ -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);