diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-03-08 15:29:21 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-03-08 15:29:21 +0000 |
commit | b66b84e557425c7247f5cde05a334cea9e4bb571 (patch) | |
tree | bcb02d5cb1e10a30cfc3e3507f63982a95c75f36 | |
parent | c4187679948bc97445477cfc825ccdeecb5150bd (diff) | |
download | rspamd-b66b84e557425c7247f5cde05a334cea9e4bb571.tar.gz rspamd-b66b84e557425c7247f5cde05a334cea9e4bb571.zip |
[Minor] Also strip spaces at the last parameter
-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++; } |