[partition] Avoid UB by initializing size everywhere
This commit is contained in:
parent
bffaf47900
commit
fd4bc4bb17
@ -150,7 +150,7 @@ PartitionLayout::execute( Device *dev, qint64 firstSector,
|
|||||||
const PartitionRole& role )
|
const PartitionRole& role )
|
||||||
{
|
{
|
||||||
QList< Partition* > partList;
|
QList< Partition* > partList;
|
||||||
qint64 size, minSize, maxSize, end;
|
qint64 minSize, maxSize, end;
|
||||||
qint64 totalSize = lastSector - firstSector + 1;
|
qint64 totalSize = lastSector - firstSector + 1;
|
||||||
qint64 availableSize = totalSize;
|
qint64 availableSize = totalSize;
|
||||||
|
|
||||||
@ -161,6 +161,7 @@ PartitionLayout::execute( Device *dev, qint64 firstSector,
|
|||||||
{
|
{
|
||||||
Partition *currentPartition = nullptr;
|
Partition *currentPartition = nullptr;
|
||||||
|
|
||||||
|
qint64 size = -1;
|
||||||
// Calculate partition size
|
// Calculate partition size
|
||||||
if ( part.partSize.isValid() )
|
if ( part.partSize.isValid() )
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user