diff options
author | Anton Yuzhaninov <citrin+github@citrin.ru> | 2019-06-24 12:13:31 +0100 |
---|---|---|
committer | Anton Yuzhaninov <citrin+github@citrin.ru> | 2019-06-24 13:34:07 +0100 |
commit | 4977a84b1835cd67ed2a909fd91b52375ec2fb53 (patch) | |
tree | fbd634926d48ab466491c17272c784467450689f /src/plugins/lua | |
parent | 014c2a2585f1c3aef3f5e6aefeaa5fe0d4310f3e (diff) | |
download | rspamd-4977a84b1835cd67ed2a909fd91b52375ec2fb53.tar.gz rspamd-4977a84b1835cd67ed2a909fd91b52375ec2fb53.zip |
[Minor] Check that ASN extracted from DNS record is numeris
Diffstat (limited to 'src/plugins/lua')
-rw-r--r-- | src/plugins/lua/asn.lua | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/plugins/lua/asn.lua b/src/plugins/lua/asn.lua index 5adc2bd7f..7f236ca99 100644 --- a/src/plugins/lua/asn.lua +++ b/src/plugins/lua/asn.lua @@ -42,8 +42,12 @@ local function asn_check(task) local descr_t = {} local mempool = task:get_mempool() if asn then - mempool:set_variable("asn", asn) - table.insert(descr_t, "asn:" .. asn) + if tonumber(asn) ~= nil then + mempool:set_variable("asn", asn) + table.insert(descr_t, "asn:" .. asn) + else + rspamd_logger.errx(task, 'malformed ASN "%s" for ip %s', asn, task:get_from_ip()) + end end if ipnet then mempool:set_variable("ipnet", ipnet) |