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 <[email protected]>
This commit is contained in:
Jérôme Duval
2019-12-22 11:35:57 +00:00
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;