mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-28 14:50:08 +03:00
Bug #1810: Fix oned crash when calling attachdisk with an improperly formated DISK template
Signed-off-by: Simon Boulet <simon@nostalgeek.com>
This commit is contained in:
parent
8276e4defc
commit
60b47c7183
@ -393,7 +393,7 @@ public:
|
||||
/**
|
||||
* Clones the current attribute
|
||||
*/
|
||||
Attribute* clone() const
|
||||
VectorAttribute* clone() const
|
||||
{
|
||||
return new VectorAttribute(*this);
|
||||
};
|
||||
|
@ -1686,7 +1686,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
|
||||
|
Loading…
x
Reference in New Issue
Block a user