]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
daf: fix add() handling of empty rule strings
authorPetr Špaček <petr.spacek@nic.cz>
Tue, 31 Mar 2020 15:31:00 +0000 (17:31 +0200)
committerTomas Krizek <tomas.krizek@nic.cz>
Thu, 2 Apr 2020 11:57:32 +0000 (13:57 +0200)
modules/daf/daf.lua

index 0ddb62b233dbd80c1281a3b369a6db87c614da06..282d03e92b318097fd37d38104f6910cc290d7db 100644 (file)
@@ -75,6 +75,9 @@ end
 local function parse_rule(g)
        -- Allow action without filter
        local tok = g()
+       if tok == nil then
+               error('empty rule is not allowed')
+       end
        if not filters[tok:lower()] then
                return tok, nil
        end