Parcourir la source

[Minor] Check that ASN extracted from DNS record is numeris

tags/2.0
Anton Yuzhaninov il y a 5 ans
Parent
révision
4977a84b18
1 fichiers modifiés avec 6 ajouts et 2 suppressions
  1. 6
    2
      src/plugins/lua/asn.lua

+ 6
- 2
src/plugins/lua/asn.lua Voir le fichier

@@ -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)

Chargement…
Annuler
Enregistrer