]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Fix nested composites process
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 22 Jun 2018 11:54:10 +0000 (12:54 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 22 Jun 2018 11:54:10 +0000 (12:54 +0100)
src/libserver/composites.c

index f3dc7a956fccdab1a60338b4054fbdbfe9493733..f0a079b7bdccd6b7d9d36a041625226cb653c0b0 100644 (file)
@@ -130,12 +130,17 @@ rspamd_composite_process_single_symbol (struct composites_data *cd,
                                        sym, cd->composite->sym);
 
                        if (isclr (cd->checked, ncomp->id * 2)) {
+                               struct rspamd_composite *saved;
+
                                msg_debug_composites ("composite dependency %s for %s is not checked",
                                                sym, cd->composite->sym);
                                /* Set checked for this symbol to avoid cyclic references */
                                setbit (cd->checked, cd->composite->id * 2);
+                               saved = cd->composite;
+                               cd->composite = ncomp;
                                rc = rspamd_process_expression (ncomp->expr,
                                                RSPAMD_EXPRESSION_FLAG_NOOPT, cd);
+                               cd->composite = saved;
                                clrbit (cd->checked, cd->composite->id * 2);
 
                                if (rc != 0) {