iv-manager: Don't allow zero max_ikev1_exchanges

This would cause a use-after-free because `lookup_iv()` inserts, removes
and destroys the still returned entry.

Fixes: aeaab528e8 ("ikev1: Factor out IV and QM management")
This commit is contained in:
Tobias Brunner
2026-07-24 08:47:39 +02:00
parent 8bcc47b818
commit 677b915efe
+1
View File
@@ -352,6 +352,7 @@ iv_manager_t *iv_manager_create(int max_exchanges)
{
this->max_exchanges = lib->settings->get_int(lib->settings,
"%s.max_ikev1_exchanges", MAX_EXCHANGES_DEFAULT, lib->ns);
this->max_exchanges = this->max_exchanges ?: MAX_EXCHANGES_DEFAULT;
}
return &this->public;
}