vfs: check userland buffers before reading them.
[haiku.git] / src / add-ons / kernel / file_systems / nfs4 / RPCCallbackReply.cpp
blob595bb0989ffc0f7ec3227d5e67e3847e112c6272
1 /*
2 * Copyright 2012 Haiku, Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
5 * Authors:
6 * Paweł Dziepak, pdziepak@quarnos.org
7 */
10 #include "RPCCallbackReply.h"
12 #include <util/kernel_cpp.h>
14 #include "RPCDefs.h"
17 using namespace RPC;
20 CallbackReply::CallbackReply()
25 CallbackReply*
26 CallbackReply::Create(uint32 xid, AcceptStat rpcError)
28 CallbackReply* reply = new(std::nothrow) CallbackReply;
29 if (reply == NULL)
30 return NULL;
32 reply->fStream.AddUInt(xid);
34 reply->fStream.AddInt(REPLY);
35 reply->fStream.AddUInt(MSG_ACCEPTED);
37 reply->fStream.AddInt(AUTH_NONE);
38 reply->fStream.AddOpaque(NULL, 0);
40 reply->fStream.AddUInt(rpcError);
42 return reply;
46 CallbackReply::~CallbackReply()