diff options
Diffstat (limited to 'src/libserver/dkim.c')
-rw-r--r-- | src/libserver/dkim.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/libserver/dkim.c b/src/libserver/dkim.c index 8f41d6220..9692d1b93 100644 --- a/src/libserver/dkim.c +++ b/src/libserver/dkim.c @@ -999,11 +999,24 @@ rspamd_create_dkim_context (const gchar *sig, } } else if (p == end) { - if (param == DKIM_PARAM_UNKNOWN || - !parser_funcs[param](ctx, c, p - c, err)) { + if (param == DKIM_PARAM_UNKNOWN) { state = DKIM_STATE_ERROR; } else { + gint tlen = p - c; + const gchar *tmp = p - 1; + + while (tlen > 0) { + if (!g_ascii_isspace (*tmp)) { + break; + } + tlen --; + tmp --; + } + + if (!parser_funcs[param](ctx, c, tlen, err)) { + state = DKIM_STATE_ERROR; + } /* Finish processing */ p++; } |