mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-19 03:12:55 +09:00
Bug #1810: Fix oned crash when calling attachdisk with an improperly formated DISK template
Signed-off-by: Simon Boulet <simon@nostalgeek.com>
(cherry picked from commit 60b47c7183)
This commit is contained in:
1 parent
f562940532
commit
5031df5ade
2 files changed
+10
-2
No files matched your search
+1
-1
@@ -355,7 +355,7 @@ public:
|
||||
/**
|
||||
* Clones the current attribute
|
||||
*/
|
||||
Attribute* clone() const
|
||||
VectorAttribute* clone() const
|
||||
{
|
||||
return new VectorAttribute(*this);
|
||||
};
|
||||
|
||||
@@ -1260,7 +1260,15 @@ VectorAttribute * VirtualMachine::set_up_attach_disk(
|
||||
return 0;
|
||||
}
|
||||
|
||||
new_disk = new VectorAttribute(*(dynamic_cast<VectorAttribute * >(disks[0])));
|
||||
new_disk = dynamic_cast<VectorAttribute * >(disks[0]);
|
||||
|
||||
if ( new_disk == 0 )
|
||||
{
|
||||
error_str = "Internal error parsing DISK attribute";
|
||||
return 0;
|
||||
}
|
||||
|
||||
new_disk = new_disk->clone();
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// Acquire the new disk image
|
||||
|
||||
Reference in new issue
Block a user