From ca5eb63fba2cf48f1ff9a27f0734019cea8ceb8c Mon Sep 17 00:00:00 2001 From: Peter van Dijk Date: Sun, 27 Jan 2019 19:16:12 +0100 Subject: [PATCH] fix off-by-one in mvRule counting this makes mvRule(0,x) work where x is the highest rule number --- pdns/dnsdist-lua-rules.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pdns/dnsdist-lua-rules.cc b/pdns/dnsdist-lua-rules.cc index 9d83032bf..ef02dcffc 100644 --- a/pdns/dnsdist-lua-rules.cc +++ b/pdns/dnsdist-lua-rules.cc @@ -168,7 +168,7 @@ static void mvRule(GlobalStateHolder > *someRespRulActions, unsigned i } auto subject = rules[from]; rules.erase(rules.begin()+from); - if(to == rules.size()) + if(to > rules.size()) rules.push_back(subject); else { if(from < to) -- 2.40.0