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);
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);
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