diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2014-05-01 17:11:16 -0700 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2014-05-01 17:11:16 -0700 |
commit | 2382edd71de686e80e46399ab3f0d3c07cd4c488 (patch) | |
tree | 2091566b7592612a97bc2be6446407d819ccd3ef | |
parent | 1b46701879ae2fb8f75ab63a7e5d7ae7da4f29b3 (diff) | |
download | rspamd-2382edd71de686e80e46399ab3f0d3c07cd4c488.tar.gz rspamd-2382edd71de686e80e46399ab3f0d3c07cd4c488.zip |
Refuse invalid DKIM keys.
-rw-r--r-- | src/libserver/dkim.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libserver/dkim.c b/src/libserver/dkim.c index e5e3639bb..abc8ddc05 100644 --- a/src/libserver/dkim.c +++ b/src/libserver/dkim.c @@ -638,6 +638,10 @@ rspamd_dkim_make_key (const gchar *keydata, guint keylen, GError **err) { rspamd_dkim_key_t *key = NULL; + if (keylen < 3) { + msg_err ("DKIM key is too short to be valid"); + return NULL; + } key = g_slice_alloc0 (sizeof (rspamd_dkim_key_t)); key->keydata = g_slice_alloc (keylen + 1); rspamd_strlcpy (key->keydata, keydata, keylen + 1); |