1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-01-20 14:03:36 +03:00

B #6692: Check VMGroupRole in Inter-role Anti-affinity rules

Add a check before dereferencing the group roles pointer.

(cherry picked from commit 48bab98a255eb9b335a18f21151b67747682fa00)
This commit is contained in:
marchenkov.s 2024-08-11 22:27:04 +03:00 committed by Ruben S. Montero
parent 34ccd7261b
commit 1607b4a014
No known key found for this signature in database
GPG Key ID: A0CEA6FA880A1D87

View File

@ -176,6 +176,11 @@ void VMGroupXML::set_antiaffinity_requirements(VirtualMachinePoolXML * vmpool,
VMGroupRole * r = roles.get(i);
if ( r == 0 )
{
continue;
}
const std::set<int>& vms = r->get_vms();
for ( auto vm_id : vms )