Fix potential uninitialized variable bug in BLayout::AllUnarchived().
BMessage::GetInfo() doesn't set the count output var in error cases.
This commit is contained in:
@@ -468,7 +468,7 @@ BLayout::AllUnarchived(const BMessage* from)
|
|||||||
if (err != B_OK)
|
if (err != B_OK)
|
||||||
return err;
|
return err;
|
||||||
|
|
||||||
int32 itemCount;
|
int32 itemCount = 0;
|
||||||
unarchiver.ArchiveMessage()->GetInfo(kLayoutItemField, NULL, &itemCount);
|
unarchiver.ArchiveMessage()->GetInfo(kLayoutItemField, NULL, &itemCount);
|
||||||
for (int32 i = 0; i < itemCount && err == B_OK; i++) {
|
for (int32 i = 0; i < itemCount && err == B_OK; i++) {
|
||||||
BLayoutItem* item;
|
BLayoutItem* item;
|
||||||
|
|||||||
Reference in New Issue
Block a user