]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Additional safe guard when removing symbols
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 22 Jun 2018 15:30:55 +0000 (16:30 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 22 Jun 2018 15:30:55 +0000 (16:30 +0100)
src/libserver/composites.c

index 2ac8209905eefac92d1910703260fa89564a9d15..f7c31bb2013fd44ea23aa029e82e52fca29cbfd7 100644 (file)
@@ -422,11 +422,7 @@ composites_remove_symbols (gpointer key, gpointer value, gpointer data)
                }
        }
 
-       if (has_valid_op) {
-               if (want_remove_symbol || want_forced) {
-                       rd->ms->flags |= RSPAMD_SYMBOL_RESULT_IGNORED;
-                       msg_debug_composites ("remove symbol %s", key);
-               }
+       if (has_valid_op && !(rd->ms->flags & RSPAMD_SYMBOL_RESULT_IGNORED)) {
 
                if (want_remove_score || want_forced) {
                        msg_debug_composites ("remove symbol weight for %s (was %.2f)",
@@ -434,6 +430,11 @@ composites_remove_symbols (gpointer key, gpointer value, gpointer data)
                        cd->metric_res->score -= rd->ms->score;
                        rd->ms->score = 0.0;
                }
+
+               if (want_remove_symbol || want_forced) {
+                       rd->ms->flags |= RSPAMD_SYMBOL_RESULT_IGNORED;
+                       msg_debug_composites ("remove symbol %s", key);
+               }
        }
 }