PDF Printer: Check FlattenedSize() result for error

CID 610903
This commit is contained in:
Philippe Saint-Pierre 2015-07-03 14:27:31 -04:00
parent bd97c88ac3
commit 5889eb7c47

View File

@ -115,11 +115,13 @@ PrinterSettings::ReadSettings(BMessage *msg)
status_t
PrinterSettings::WriteSettings(BMessage* msg)
{
size_t length;
ssize_t length;
char *data = NULL;
status_t err = B_ERROR;
length = msg->FlattenedSize();
if (length < B_OK)
return length;
data = (char *) malloc(length);
if (data != NULL) {
msg->Flatten(data, length);