Do some minimal sanity checks on the message data. Avoids trying to allocate
random amounts of memory when getting an invalid header. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42770 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
2ce1337c71
commit
0d890a6821
@ -9,6 +9,7 @@
|
||||
#include <new>
|
||||
|
||||
#include <AutoDeleter.h>
|
||||
#include <MessageAdapter.h>
|
||||
#include <MessagePrivate.h>
|
||||
|
||||
#include "Architecture.h"
|
||||
@ -259,6 +260,10 @@ BMessageValueNode::ResolvedLocationAndValue(ValueLoader* valueLoader,
|
||||
if (error != B_OK)
|
||||
return error;
|
||||
|
||||
if (fHeader->format != MESSAGE_FORMAT_HAIKU
|
||||
|| (fHeader->flags & MESSAGE_FLAG_VALID) == 0)
|
||||
return B_NOT_A_MESSAGE;
|
||||
|
||||
if (fIsFlatMessage)
|
||||
what.SetTo(fHeader->what);
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user