1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +03:00

B OpenNebula seg faults when there are gaps in the history sequence

(cherry picked from commit ea357cc58f88c634f08d848e369a4c4ae0f2ae42)
This commit is contained in:
Ruben S. Montero 2017-08-07 14:08:28 +02:00
parent 25df1f1607
commit 6cf8bb3136

View File

@ -2128,10 +2128,16 @@ int VirtualMachine::from_xml(const string &xml_str)
if ( xpath(last_seq,"/VM/HISTORY_RECORDS/HISTORY/SEQ", -1) == 0 &&
last_seq != -1 )
{
history_records.resize(last_seq + 1);
for (int i=0; i <= last_seq; ++i)
{
history_records[i] = 0;
}
history = new History(oid, last_seq);
history_records.resize(history->seq + 1);
history_records[history->seq] = history;
history_records[last_seq] = history;
}
// -------------------------------------------------------------------------