]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[5577] Fixed out of bound bug
authorFrancis Dupont <fdupont@isc.org>
Mon, 26 Mar 2018 16:51:16 +0000 (18:51 +0200)
committerTomek Mrugalski <tomasz@isc.org>
Wed, 16 May 2018 13:48:57 +0000 (15:48 +0200)
src/lib/hooks/callout_manager.cc

index e0b3bc073d476fdeadf4d04d74da0223f6afd7ae..55d4a5fd66c4f618dda1071253e1cb268d803b99 100644 (file)
@@ -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.