commit d68773e: [Minor] Fix the case of empty flags :(

Vsevolod Stakhov vsevolod at highsecure.ru
Tue Apr 21 18:56:06 UTC 2020


Author: Vsevolod Stakhov
Date: 2020-04-21 19:52:01 +0100
URL: https://github.com/rspamd/rspamd/commit/d68773eabfb004bef9f865975714d3c06a9b972d (HEAD -> master)

[Minor] Fix the case of empty flags :(

---
 src/lua/lua_url.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/lua/lua_url.c b/src/lua/lua_url.c
index 45f9ab683..ed1eb1901 100644
--- a/src/lua/lua_url.c
+++ b/src/lua/lua_url.c
@@ -933,7 +933,8 @@ lua_tree_url_callback (gpointer key, gpointer value, gpointer ud)
 	struct rspamd_url *url = (struct rspamd_url *)value;
 	struct lua_tree_cb_data *cb = ud;
 
-	if ((url->protocol & cb->protocols_mask) && (url->flags & cb->flags_mask)) {
+	if ((url->protocol & cb->protocols_mask) && (url->flags == 0 ||
+			(url->flags & cb->flags_mask))) {
 
 		if (cb->skip_prob > 0) {
 			gdouble coin = rspamd_random_double_fast_seed (cb->xoroshiro_state);


More information about the Commits mailing list