From 8a3312ad64950aab2b494754e32ae974cccf8fa4 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Mon, 6 Jan 2020 14:52:43 +0000 Subject: [PATCH] [Minor] Fix GError oversetting in DKIM code --- src/libserver/dkim.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/libserver/dkim.c b/src/libserver/dkim.c index 4b66ebbd5..b3efd2149 100644 --- a/src/libserver/dkim.c +++ b/src/libserver/dkim.c @@ -1032,6 +1032,17 @@ rspamd_create_dkim_context (const gchar *sig, if (!parser_funcs[param](ctx, c, tlen, err)) { state = DKIM_STATE_ERROR; } + if (state == DKIM_STATE_ERROR) { + /* + * We need to return from here as state machine won't + * do any more steps after p == end + */ + if (err) { + msg_info_dkim ("dkim parse failed: %e", *err); + } + + return NULL; + } /* Finish processing */ p++; } -- 2.39.5