aboutsummaryrefslogtreecommitdiffstats
path: root/src/libserver/dkim.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2014-05-01 12:05:17 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2014-05-01 12:05:17 +0100
commit5c9400a2835bfc66bbd045ba3c45adde528592c4 (patch)
tree318473f8cb5e703c32b64c73712b58662602ba2e /src/libserver/dkim.c
parentf092c8362833d87d43e35cfdcdb164b17ab7e629 (diff)
downloadrspamd-5c9400a2835bfc66bbd045ba3c45adde528592c4.tar.gz
rspamd-5c9400a2835bfc66bbd045ba3c45adde528592c4.zip
Fix dkim parser for old glib.
Issue: #56 Reported by: @eneq123
Diffstat (limited to 'src/libserver/dkim.c')
-rw-r--r--src/libserver/dkim.c6
1 files 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