From: Peter van Dijk Date: Sun, 27 Jan 2019 18:16:12 +0000 (+0100) Subject: fix off-by-one in mvRule counting X-Git-Tag: auth-4.2.0-beta1~47^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F7426%2Fhead;p=thirdparty%2Fpdns.git fix off-by-one in mvRule counting this makes mvRule(0,x) work where x is the highest rule number --- diff --git a/pdns/dnsdist-lua-rules.cc b/pdns/dnsdist-lua-rules.cc index 9d83032bf9..ef02dcffcc 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)