]> source.dussan.org Git - rspamd.git/commitdiff
[CritFix] Do not trust remote shingles count
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 5 Jan 2017 12:44:33 +0000 (12:44 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 5 Jan 2017 12:44:33 +0000 (12:44 +0000)
MFH: true

src/libserver/fuzzy_backend_redis.c

index b89dde8cc820df4c0ac23a50efdecb70032aa522..3804e9fd0cf77cbce35f96ffed2b286784ff4d35 100644 (file)
@@ -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) {