diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-02-10 23:09:36 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-02-10 23:09:36 +0000 |
commit | 487588eb24a79e284a139174bc1b88bd8af4d67e (patch) | |
tree | 9e752d80ac04b99b6e22cb2e420611a7f0e6d6ff | |
parent | 6f07e6f9f260fcd5331b4cd22ed7ef9484cfc823 (diff) | |
download | rspamd-487588eb24a79e284a139174bc1b88bd8af4d67e.tar.gz rspamd-487588eb24a79e284a139174bc1b88bd8af4d67e.zip |
Fix issue with out-of-boundary reading
Found by: coverity scan
-rw-r--r-- | src/fuzzy_storage.c | 2 |
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 */ |