From 92d022ed697ce85c33cd6396cfe6a780a9de786a Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Tue, 1 Aug 2023 10:55:16 +0200 Subject: [PATCH] dnsdist: Add a comment indicating we are fine with at() throwing --- pdns/dnsdist-lua-rules.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pdns/dnsdist-lua-rules.cc b/pdns/dnsdist-lua-rules.cc index 860231ad05..2495b4a9ee 100644 --- a/pdns/dnsdist-lua-rules.cc +++ b/pdns/dnsdist-lua-rules.cc @@ -262,6 +262,8 @@ static boost::optional getRuleFromSelector(const std::vector& rules, const } } else if (auto pos = boost::get(&selector)) { + /* this will throw a std::out_of_range exception if the + supplied position is out of bounds, this is fine */ return rules.at(*pos); } return boost::none; -- 2.47.2