virtio RNG: fix SMAP violation

Change-Id: I82fadcef6d3f402b10273b6f378d5357f3c835c3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3716
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
This commit is contained in:
Adrien Destugues 2021-01-30 16:51:43 +01:00 committed by Adrien Destugues
parent e248c98eb8
commit c05253c64e

View File

@ -117,7 +117,8 @@ VirtioRNGDevice::Read(void* _buffer, size_t* _numBytes)
if (fOffset < BUFFER_SIZE) {
size_t size = min_c(BUFFER_SIZE - fOffset, *_numBytes);
memcpy(_buffer, fBuffer + fOffset, size);
if (user_memcpy(_buffer, fBuffer + fOffset, size) != B_OK)
return B_BAD_ADDRESS;
fOffset += size;
*_numBytes = size;
} else