From: Francis Dupont Date: Mon, 26 Mar 2018 16:51:16 +0000 (+0200) Subject: [5577] Fixed out of bound bug X-Git-Tag: trac5549a_base~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0034ae970c41715efbe03b7272e852b191baff3b;p=thirdparty%2Fkea.git [5577] Fixed out of bound bug --- diff --git a/src/lib/hooks/callout_manager.cc b/src/lib/hooks/callout_manager.cc index e0b3bc073d..55d4a5fd66 100644 --- a/src/lib/hooks/callout_manager.cc +++ b/src/lib/hooks/callout_manager.cc @@ -70,6 +70,11 @@ CalloutManager::registerCallout(const std::string& name, CalloutPtr callout) { // process). int hook_index = server_hooks_.getIndex(name); + // New hooks can have been registered since the manager was constructed. + if (hook_index >= hook_vector_.size()) { + hook_vector_.resize(server_hooks_.getCount()); + } + // Iterate through the callout vector for the hook from start to end, // looking for the first entry where the library index is greater than // the present index.