From 981c729bdca928743f9bf6e7fc611563c312cbc3 Mon Sep 17 00:00:00 2001 From: Alex Wilson Date: Wed, 28 Dec 2011 22:50:25 -0700 Subject: [PATCH] Fix potential uninitialized variable bug in BLayout::AllUnarchived(). BMessage::GetInfo() doesn't set the count output var in error cases. --- src/kits/interface/Layout.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/kits/interface/Layout.cpp b/src/kits/interface/Layout.cpp index bce47bc403..6b873726e7 100644 --- a/src/kits/interface/Layout.cpp +++ b/src/kits/interface/Layout.cpp @@ -468,7 +468,7 @@ BLayout::AllUnarchived(const BMessage* from) if (err != B_OK) return err; - int32 itemCount; + int32 itemCount = 0; unarchiver.ArchiveMessage()->GetInfo(kLayoutItemField, NULL, &itemCount); for (int32 i = 0; i < itemCount && err == B_OK; i++) { BLayoutItem* item;