Commit 98781a7a authored by Francis Dupont's avatar Francis Dupont Committed by Tomek Mrugalski
Browse files

[5577] Another case of out-of-bound access

parent 0034ae97
......@@ -242,6 +242,11 @@ CalloutManager::deregisterCallout(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()) {
return (false);
}
/// Construct a CalloutEntry matching the current library and the callout
/// we want to remove.
CalloutEntry target(current_library_, callout);
......@@ -285,6 +290,11 @@ CalloutManager::deregisterAllCallouts(const std::string& name) {
// 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()) {
return (false);
}
/// Construct a CalloutEntry matching the current library (the callout
/// pointer is NULL as we are not checking that).
CalloutEntry target(current_library_, static_cast<CalloutPtr>(0));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment