commit ab79340: [Minor] Check ucl object type

Vsevolod Stakhov vsevolod at rspamd.com
Sat Aug 27 22:56:03 UTC 2022


Author: Vsevolod Stakhov
Date: 2022-08-27 23:47:28 +0100
URL: https://github.com/rspamd/rspamd/commit/ab79340651d76419815adb5359db685a5680fdc7 (HEAD -> master)

[Minor] Check ucl object type

---
 src/libserver/milter.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/libserver/milter.c b/src/libserver/milter.c
index e559495fb..f8ed7be32 100644
--- a/src/libserver/milter.c
+++ b/src/libserver/milter.c
@@ -1697,7 +1697,7 @@ rspamd_milter_extract_single_header (struct rspamd_milter_session *session,
 		idx_obj = ucl_object_lookup_any (obj, "order",
 				"index", NULL);
 
-		if (idx_obj) {
+		if (idx_obj && (ucl_object_type (idx_obj) == UCL_INT || ucl_object_type (idx_obj) == UCL_FLOAT)) {
 			idx = ucl_object_toint (idx_obj);
 			has_idx = TRUE;
 		}


More information about the Commits mailing list