aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-02-10 23:09:36 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-02-10 23:09:36 +0000
commit487588eb24a79e284a139174bc1b88bd8af4d67e (patch)
tree9e752d80ac04b99b6e22cb2e420611a7f0e6d6ff
parent6f07e6f9f260fcd5331b4cd22ed7ef9484cfc823 (diff)
downloadrspamd-487588eb24a79e284a139174bc1b88bd8af4d67e.tar.gz
rspamd-487588eb24a79e284a139174bc1b88bd8af4d67e.zip
Fix issue with out-of-boundary reading
Found by: coverity scan
-rw-r--r--src/fuzzy_storage.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/fuzzy_storage.c b/src/fuzzy_storage.c
index 8d02732fa..ca28ebe79 100644
--- a/src/fuzzy_storage.c
+++ b/src/fuzzy_storage.c
@@ -587,7 +587,7 @@ rspamd_fuzzy_decrypt_command (struct fuzzy_session *s)
s->key_stat = key->stat;
/* Now process keypair */
- memcpy (rk.pk, hdr->pubkey, sizeof (rk.pk));
+ memcpy (rk.pk, hdr->pubkey, MIN(sizeof (hdr->pubkey), sizeof (rk.pk)));
rspamd_keypair_cache_process (s->ctx->keypair_cache, key->key, &rk);
/* Now decrypt request */