PDF Printer: Check FlattenedSize() result for error
CID 610903
This commit is contained in:
parent
bd97c88ac3
commit
5889eb7c47
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user