Skip to content

Commit

Permalink
NetBuffer: Check result of FlattenedSize() for error
Browse files Browse the repository at this point in the history
CID 610923
  • Loading branch information
stpere committed Jul 3, 2015
1 parent 5889eb7 commit a495c5e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/kits/network/libnetapi/NetBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,11 @@ BNetBuffer::AppendMessage(const BMessage& data)
{
char stackFlattenedData[STACK_BUFFER_SIZE];

size_t dataSize = data.FlattenedSize();
ssize_t dataSize = data.FlattenedSize();

if (dataSize < B_OK)
return dataSize;

if (dataSize == 0)
return B_ERROR;

Expand Down

0 comments on commit a495c5e

Please sign in to comment.