mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-10 06:24:35 +09:00
B OpenNebula seg faults when there are gaps in the history sequence
(cherry picked from commit ea357cc58f)
This commit is contained in:
1 parent
25df1f1607
commit
6cf8bb3136
1 file changed
+8
-2
@@ -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;
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
Reference in new issue
Block a user