From: Vsevolod Stakhov Date: Wed, 9 Dec 2020 13:39:41 +0000 (+0000) Subject: [Minor] Do not use static buffers X-Git-Tag: 2.7~82 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=076afbad6335b2e6bd643cc453bf3c2437edbe60;p=thirdparty%2Frspamd.git [Minor] Do not use static buffers --- diff --git a/src/libserver/dkim.c b/src/libserver/dkim.c index 691daef79f..f6274a3d66 100644 --- a/src/libserver/dkim.c +++ b/src/libserver/dkim.c @@ -1693,11 +1693,11 @@ rspamd_dkim_relaxed_body_step (struct rspamd_dkim_common_ctx *ctx, EVP_MD_CTX *c gssize *remain) { const gchar *h; - static gchar buf[BUFSIZ]; gchar *t; guint len, inlen; gssize octets_remain; gboolean got_sp; + gchar buf[1024]; len = size; inlen = sizeof (buf) - 1; @@ -1707,6 +1707,7 @@ rspamd_dkim_relaxed_body_step (struct rspamd_dkim_common_ctx *ctx, EVP_MD_CTX *c octets_remain = *remain; while (len > 0 && inlen > 0 && (octets_remain != 0)) { + if (*h == '\r' || *h == '\n') { if (got_sp) { /* Ignore spaces at the end of line */ @@ -1783,10 +1784,10 @@ rspamd_dkim_simple_body_step (struct rspamd_dkim_common_ctx *ctx, gssize *remain) { const gchar *h; - static gchar buf[BUFSIZ]; gchar *t; guint len, inlen; gssize octets_remain; + gchar buf[1024]; len = size; inlen = sizeof (buf) - 1;