userlandfs: ReadAttr() with user_memcpy()
should fix #14969 Change-Id: Iaf4e1362841b65cb56f112d379db041ef3d8ab08 Reviewed-on: https://review.haiku-os.org/c/haiku/+/2047 Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
This commit is contained in:
parent
39147a617f
commit
d7690f68a8
@ -2882,8 +2882,10 @@ Volume::ReadAttr(void* _node, void* cookie, off_t pos,
|
||||
|| reply->bytesRead > bufferSize) {
|
||||
return B_BAD_DATA;
|
||||
}
|
||||
if (reply->bytesRead > 0)
|
||||
memcpy(buffer, readBuffer, reply->bytesRead);
|
||||
if (reply->bytesRead > 0
|
||||
&& user_memcpy(buffer, readBuffer, reply->bytesRead) < B_OK) {
|
||||
return B_BAD_ADDRESS;
|
||||
}
|
||||
*bytesRead = reply->bytesRead;
|
||||
_SendReceiptAck(port);
|
||||
return error;
|
||||
|
Loading…
Reference in New Issue
Block a user