diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-01-05 12:44:33 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-01-05 12:44:33 +0000 |
commit | a31674d2750f68641f3eb8c588a7e71312b9dc76 (patch) | |
tree | 85c7b2382e436af0e589d4dc732edbc5621e0831 | |
parent | ecf45b87ea407d55131e72fa443c14a6ff6d4b13 (diff) | |
download | rspamd-a31674d2750f68641f3eb8c588a7e71312b9dc76.tar.gz rspamd-a31674d2750f68641f3eb8c588a7e71312b9dc76.zip |
[CritFix] Do not trust remote shingles count
MFH: true
-rw-r--r-- | src/libserver/fuzzy_backend_redis.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/libserver/fuzzy_backend_redis.c b/src/libserver/fuzzy_backend_redis.c index b89dde8cc..3804e9fd0 100644 --- a/src/libserver/fuzzy_backend_redis.c +++ b/src/libserver/fuzzy_backend_redis.c @@ -464,7 +464,7 @@ rspamd_fuzzy_backend_check_shingles (struct rspamd_fuzzy_redis_session *session) rspamd_fuzzy_redis_session_free_args (session); /* First of all check digest */ - session->nargs = session->cmd->shingles_count + 1; + session->nargs = RSPAMD_SHINGLE_SIZE + 1; session->argv = g_malloc (sizeof (gchar *) * session->nargs); session->argv_lens = g_malloc (sizeof (gsize) * session->nargs); shcmd = (const struct rspamd_fuzzy_shingle_cmd *)session->cmd; @@ -484,7 +484,6 @@ rspamd_fuzzy_backend_check_shingles (struct rspamd_fuzzy_redis_session *session) g_assert (session->ctx != NULL); - if (redisAsyncCommandArgv (session->ctx, rspamd_fuzzy_redis_shingles_callback, session, session->nargs, (const gchar **)session->argv, session->argv_lens) != REDIS_OK) { |