commit cf45101: [Minor] Fix flags and protocols checks

Vsevolod Stakhov vsevolod at highsecure.ru
Thu Apr 30 14:28:06 UTC 2020


Author: Vsevolod Stakhov
Date: 2020-04-30 15:25:29 +0100
URL: https://github.com/rspamd/rspamd/commit/cf45101d02820f8eec4afe99305ca81e59dfdb78 (HEAD -> master)

[Minor] Fix flags and protocols checks

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

diff --git a/src/lua/lua_url.c b/src/lua/lua_url.c
index 6652fdaac..f07f94bbd 100644
--- a/src/lua/lua_url.c
+++ b/src/lua/lua_url.c
@@ -933,8 +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 == 0 ||
-			(url->flags & cb->flags_mask))) {
+	if ((url->protocol & cb->protocols_mask) == url->protocol &&
+		(url->flags == (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