From 7bbf934bd25b81aee2d87679cb48d4fae5202706 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Mon, 9 Mar 2015 23:44:28 +0000 Subject: [PATCH] Fix allocated_len calculation found by fuzz testing. --- src/libutil/util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- 2.39.5