]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Fix order of symbol options
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 23 Mar 2017 10:54:13 +0000 (10:54 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 23 Mar 2017 10:54:38 +0000 (10:54 +0000)
src/lua/lua_config.c

index a519be2aef41eb2be53352cbba66064bf2f467a6..e6e66b900480ad1b8e9954ad826ac6ba117bdb5f 100644 (file)
@@ -940,7 +940,9 @@ lua_metric_symbol_callback (struct rspamd_task *task, gpointer ud)
                                s = rspamd_task_insert_result (task, cd->symbol, flag, NULL);
 
                                if (s) {
-                                       for (i = lua_gettop (L); i >= level + first_opt; i--) {
+                                       guint last_pos = lua_gettop (L);
+
+                                       for (i = level + first_opt; i <= last_pos; i++) {
                                                if (lua_type (L, i) == LUA_TSTRING) {
                                                        const char *opt = lua_tostring (L, i);