PDF Printer: Check FlattenedSize() result for error
CID 610903
This commit is contained in:
@@ -115,11 +115,13 @@ PrinterSettings::ReadSettings(BMessage *msg)
|
|||||||
status_t
|
status_t
|
||||||
PrinterSettings::WriteSettings(BMessage* msg)
|
PrinterSettings::WriteSettings(BMessage* msg)
|
||||||
{
|
{
|
||||||
size_t length;
|
ssize_t length;
|
||||||
char *data = NULL;
|
char *data = NULL;
|
||||||
status_t err = B_ERROR;
|
status_t err = B_ERROR;
|
||||||
|
|
||||||
length = msg->FlattenedSize();
|
length = msg->FlattenedSize();
|
||||||
|
if (length < B_OK)
|
||||||
|
return length;
|
||||||
data = (char *) malloc(length);
|
data = (char *) malloc(length);
|
||||||
if (data != NULL) {
|
if (data != NULL) {
|
||||||
msg->Flatten(data, length);
|
msg->Flatten(data, length);
|
||||||
|
|||||||
Reference in New Issue
Block a user