kernel-pfkey: Add sanity check when deleting policies
This commit is contained in:
1 parent
e5455e9413
commit
e7d717cf01
1 file changed
+5
@@ -2543,6 +2543,11 @@ METHOD(kernel_ipsec_t, del_policy, status_t,
|
||||
first = FALSE;
|
||||
}
|
||||
enumerator->destroy(enumerator);
|
||||
if (!to_remove)
|
||||
{ /* sanity check */
|
||||
this->mutex->unlock(this->mutex);
|
||||
return SUCCESS;
|
||||
}
|
||||
policy->used_by->remove(policy->used_by, to_remove, NULL);
|
||||
mapping = to_remove;
|
||||
|
||||
|
||||
Reference in new issue
Block a user