commit 076afba: [Minor] Do not use static buffers

Vsevolod Stakhov vsevolod at highsecure.ru
Wed Dec 9 14:07:06 UTC 2020


Author: Vsevolod Stakhov
Date: 2020-12-09 13:39:41 +0000
URL: https://github.com/rspamd/rspamd/commit/076afbad6335b2e6bd643cc453bf3c2437edbe60 (HEAD -> master)

[Minor] Do not use static buffers

---
 src/libserver/dkim.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/libserver/dkim.c b/src/libserver/dkim.c
index 691daef79..f6274a3d6 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;


More information about the Commits mailing list