1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +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)
(cherry picked from commit 1607b4a0145c97fbb43f621822dd452d10a1dd5f)
This commit is contained in:
marchenkov.s 2024-08-11 22:27:04 +03:00 committed by Ruben S. Montero
parent 9ce5fc5fd8
commit 8c745a9596
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 )