Tracker: fix negative buffer size, CID 610926

This commit is contained in:
John Scipione 2014-07-22 22:42:01 -04:00
parent 6073b1d56d
commit d5451cc8fc

View File

@ -329,10 +329,10 @@ ExtraAttributeLazyInstaller::AddExtraAttribute(const char* publicName,
static void
InstallTemporaryBackgroundImages(BNode* node, BMessage* message)
{
int32 size = message->FlattenedSize();
ssize_t size = message->FlattenedSize();
try {
char* buffer = new char[size];
ThrowIfNotSize(size);
char* buffer = new char[(size_t)size];
message->Flatten(buffer, size);
node->WriteAttr(kBackgroundImageInfo, B_MESSAGE_TYPE, 0, buffer,
(size_t)size);