]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Fix GError oversetting in DKIM code
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 6 Jan 2020 14:52:43 +0000 (14:52 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 6 Jan 2020 14:52:43 +0000 (14:52 +0000)
src/libserver/dkim.c

index 4b66ebbd51f1f08b203b7649e3820ebc7dc9b8ed..b3efd21492509af4e6321fee01eb6fc0a62190ff 100644 (file)
@@ -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++;
                                }