Skip to content

Commit

Permalink
PDF Printer: Check FlattenedSize() result for error
Browse files Browse the repository at this point in the history
CID 610903
  • Loading branch information
stpere committed Jul 3, 2015
1 parent bd97c88 commit 5889eb7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/add-ons/print/drivers/pdf/source/PrinterSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 5889eb7

Please sign in to comment.