From 5c9400a2835bfc66bbd045ba3c45adde528592c4 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Thu, 1 May 2014 12:05:17 +0100 Subject: Fix dkim parser for old glib. Issue: #56 Reported by: @eneq123 --- src/libserver/dkim.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libserver/dkim.c b/src/libserver/dkim.c index c7c8a35e1..e5e3639bb 100644 --- a/src/libserver/dkim.c +++ b/src/libserver/dkim.c @@ -83,7 +83,7 @@ rspamd_dkim_parse_signature (rspamd_dkim_context_t* ctx, const gchar *param, gsi gchar *tmp; gsize tmp_len = len; tmp = g_base64_decode (ctx->b, &tmp_len); - rspamd_strlcpy (ctx->b, tmp, len + 1); + rspamd_strlcpy (ctx->b, tmp, tmp_len + 1); g_free (tmp); #else g_base64_decode_inplace (ctx->b, &len); @@ -334,7 +334,7 @@ rspamd_dkim_parse_bodyhash (rspamd_dkim_context_t* ctx, const gchar *param, gsiz gchar *tmp; gsize tmp_len = len; tmp = g_base64_decode (ctx->bh, &tmp_len); - rspamd_strlcpy (ctx->bh, tmp, len + 1); + rspamd_strlcpy (ctx->bh, tmp, tmp_len + 1); g_free (tmp); #else g_base64_decode_inplace (ctx->bh, &len); @@ -647,7 +647,7 @@ rspamd_dkim_make_key (const gchar *keydata, guint keylen, GError **err) gchar *tmp; gsize tmp_len = keylen; tmp = g_base64_decode (key->keydata, &tmp_len); - rspamd_strlcpy (key->keydata, tmp, keylen + 1); + rspamd_strlcpy (key->keydata, tmp, tmp_len + 1); g_free (tmp); key->decoded_len = tmp_len; #else -- cgit v1.2.3